• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/integration/intranetmanager.php
  • Класс: Bitrix\Crm\Integration\IntranetManager
  • Вызов: IntranetManager::getCustomSectionByEntityTypeId
static function getCustomSectionByEntityTypeId(int $entityTypeId): ?CustomSection
{
	$customSections = static::getCustomSections();
	if (is_null($customSections))
	{
		return null;
	}

	foreach ($customSections as $customSection)
	{
		foreach ($customSection->getPages() as $page)
		{
			$entityTypeIdInPage = static::getEntityTypeIdByPageSettings($page->getSettings());
			if (($entityTypeIdInPage > 0) && ($entityTypeIdInPage === $entityTypeId))
			{
				return $customSection;
			}
		}
	}

	return null;
}