is::getLegacyFilter

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. is
  4. getLegacyFilter
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/runtime/task.php
  • Класс: BitrixTasksInternalsRunTimeis
  • Вызов: is::getLegacyFilter
static function getLegacyFilter(array $parameters)
{
	$result = array('runtime' => array());

	$parameters = static::checkParameters($parameters);
	if(!isset($parameters['FILTER_PARAMETERS']) || !is_array($parameters['FILTER_PARAMETERS']))
	{
		$parameters['FILTER_PARAMETERS'] = array();
	}
	$parameters['FILTER_PARAMETERS']['USER_ID'] = $parameters['USER_ID'];

	$selectSql = CTasks::getSelectSqlByFilter($parameters['FILTER'], '', $parameters['FILTER_PARAMETERS']);

	$query = new BitrixMainEntityQuery('Bitrix\Tasks\Task');
	$query->setFilter(
		array(
			'@ID' => new SqlExpression($selectSql)
		)
	);
	$query->setSelect(array('ID'));

	$rf = $parameters['REF_FIELD'];
	$result['runtime'][] = new EntityReferenceField(
		$parameters['NAME'],
		BitrixMainEntityBase::getInstanceByQuery($query),
		array(
			'=this.'.((string) $rf != '' ? $rf : 'ID') => 'ref.ID'
		),
		array('join_type' => 'inner')
	);

	return $result;
}

Добавить комментарий