• Модуль: crmmobile
  • Путь к файлу: ~/bitrix/modules/crmmobile/lib/Controller/Category.php
  • Класс: BitrixCrmMobileControllerCategory
  • Вызов: Category::getPreparedFilterParams
private function getPreparedFilterParams(array $params, Kanban $kanban, Factory $factory): array
{
	$filterParams = [];
	$filter = $params['filter'];

	if (empty($filter['presetId']))
	{
		$filterParams['FORCE_FILTER'] = 'Y';
	}
	else
	{
		$filterParams['FILTER_PRESET_ID'] = $filter['presetId'];
	}

	if (isset($filter['search']))
	{
		$filterParams['filter']['SEARCH_CONTENT'] = $filter['search'];
	}

	if (isset($filter['tmpFields']))
	{
		$entityTypeId = $factory->getEntityTypeId();
		$entityTypeName = $factory->getEntityName();

		$prepareParams = array_merge($params, ['filterParams' => $filterParams]);

		$entity = $kanban->getEntity()->setGridIdInstance(new GridId($entityTypeId), $entityTypeId);

		Entity::getInstance($entityTypeName)->prepare($prepareParams)->prepareFilter($entity);
	}

	return $filterParams;
}