98 protected function getBrands(array $filter = []): array
100 if (!Loader::includeModule(
'highloadblock') || !Loader::includeModule(
'iblock'))
105 \Bitrix\Catalog\v2\Integration\Iblock\BrandProperty::createFacebookBrandProperty();
107 $catalogId = $this->options[
'iblockId'];
113 $propertySettings = PropertyTable::getList([
114 'select' => [
'ID',
'USER_TYPE_SETTINGS'],
116 '=IBLOCK_ID' => $catalogId,
118 '=CODE' => self::BRAND_CODE,
125 if (!$propertySettings)
130 $propertySettings[
'USER_TYPE_SETTINGS'] = (
131 $userTypeSettings = CheckSerializedData($propertySettings[
'USER_TYPE_SETTINGS'])
132 ? unserialize($propertySettings[
'USER_TYPE_SETTINGS'], [
'allowed_classes' =>
false])
136 if (empty($userTypeSettings[
'TABLE_NAME']))
141 $table = HL\HighloadBlockTable::getList([
142 'select' => [
'TABLE_NAME',
'NAME',
'ID'],
143 'filter' => [
'=TABLE_NAME' => $userTypeSettings[
'TABLE_NAME']],
148 $brandEntity = HL\HighloadBlockTable::compileEntity($table);
149 $brandEntityClass = $brandEntity->getDataClass();
152 'select' => [
'UF_XML_ID',
'UF_FILE',
'UF_NAME'],
157 $parameters[
'filter'] = $filter;
161 $brandsRaw = $brandEntityClass::getList($parameters);
162 while ($brand = $brandsRaw->fetch())
164 if (!empty($brand[
'UF_FILE']))
166 $brand[
'LOGO'] = \CFile::resizeImageGet(
172 BX_RESIZE_IMAGE_EXACT,