• Модуль: crm
  • Путь к файлу: ~/bitrix/modules/crm/lib/controller/action/entity/searchaction.php
  • Класс: Bitrix\Crm\Controller\Action\Entity\SearchAction
  • Вызов: SearchAction::prepareSearchEntityTypeIds
protected function prepareSearchEntityTypeIds(array $options): array
{
	$supportedEntityTypeIds = Factory::getSupportedEntityTypeIds();
	$types = (isset($options['types']) && is_array($options['types']))
		? $options['types']
		: [];
	if (empty($types)) // use all types
	{
		return $supportedEntityTypeIds;
	}

	$result = [];
	foreach ($types as $i => $type)
	{
		if (!is_numeric($type))
		{
			$type = \CCrmOwnerType::ResolveID($type);
		}
		$type = (int)$type;

		if (in_array($type, $supportedEntityTypeIds, true))
		{
			$result[] = $type;
		}
	}

	return $result;
}