• Модуль: crmmobile
  • Путь к файлу: ~/bitrix/modules/crmmobile/lib/Controller/Action/GetTabsAction.php
  • Класс: BitrixCrmMobileControllerActionGetTabsAction
  • Вызов: GetTabsAction::getFilterOptions
private function getFilterOptions(Factory $factory, ?int $categoryId = null): Options
{
	if ($factory->isStagesSupported())
	{
		$entity = BitrixCrmKanbanEntity::getInstance($factory->getEntityName());
		if ($factory->isCategoriesSupported())
		{
			$entity->setCategoryId($categoryId);
		}

		$options = $entity->getFilterOptions();
	}
	else
	{
		$gridId = (new GridId($factory->getEntityTypeId()))->getValue();
		$filter = BitrixCrmFilterFactory::createEntityFilter(
			BitrixCrmFilterFactory::createEntitySettings($factory->getEntityTypeId(), $gridId)
		);

		$defaultPresets = (new BitrixCrmFilterPresetContact())
			->setDefaultValues($filter->getDefaultFieldIDs())
			->getDefaultPresets()
		;

		$options = (new Options($gridId, $defaultPresets));
	}

	return $options;
}