- Модуль: crm
- Путь к файлу: ~/bitrix/modules/crm/lib/integration/intranet/customsection/customsectionqueries.php
- Класс: Bitrix\Crm\Integration\Intranet\CustomSection\CustomSectionQueries
- Вызов: CustomSectionQueries::findByEntityTypeIds
public function findByEntityTypeIds(array $entityTypeIds): array
{
if (!Integration\IntranetManager::isCustomSectionsAvailable())
{
return [];
}
$customSections = [];
$settingsCodes = array_map(
fn ($typeId) => Integration\IntranetManager::preparePageSettingsForItemsList($typeId),
$entityTypeIds
);
$sections = CustomSectionPageTable::query()
->setSelect(['ID', 'SETTINGS', 'CUSTOM_SECTION_ID'])
->addSelect('cs.TITLE', 'SECTION_TITLE')
->registerRuntimeField(
'',
new ReferenceField('cs',
CustomSectionTable::getEntity(),
['=ref.ID' => 'this.CUSTOM_SECTION_ID']
)
)
->where('MODULE_ID', 'crm')
->whereIn('SETTINGS', $settingsCodes)
->fetchAll();
foreach ($sections as $row)
{
$typeId = Integration\IntranetManager::getEntityTypeIdByPageSettings($row['SETTINGS']);
$row['TITLE'] = $row['S_TITLE'];
$customSections[$typeId] = $row;
}
return $customSections;
}