- Модуль: seo
- Путь к файлу: ~/bitrix/modules/seo/lib/ui/provider/interestsprovider.php
- Класс: BitrixSeoUIProviderInterestsProvider
- Вызов: InterestsProvider::doSearch
public function doSearch(SearchQuery $searchQuery, Dialog $dialog): void
{
$service = Configurator::getService();
$service->setClientId($this->getOption('clientId'));
$searchQuery->setCacheable(false);
$response = Configurator::searchTargetingData(
AdCampaignFacebook::TYPE_CODE,
[
'q' => $searchQuery->getQuery(),
'type' => static::SEARCH_TYPE
]
);
$items = [];
foreach($response as $value)
{
if(!isset($value['name']))
{
continue;
}
$topic = htmlspecialcharsbx($value['topic']);
$title = $value['name']. ($topic ?" ({$topic})" : "");
$items[] =
new Item(
[
'id' => $value['id'],
'entityId' => static::ENTITY_TYPE,
'title' => $title,
'customData' => ['audienceSize' => $value['audience_size']],
'tagOptions' => [
'bgColor' => "#{$this->stringToColor($title)}",
'textColor' => "#fff"
]
]
);
}
$dialog->addItems(
$items
);
}