is::getMemberConditions

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

	if(is_array($filter))
	{
		$filter = HelperCommon::parseFilter($filter);

		// todo: this will fail on sub-filters, LOGIC key
		foreach($filter as $info)
		{
			if((string) $info['FIELD'] === (string) '0')
			{
				$conditions[] = static::getMemberConditions($info['VALUE'], $parameters);
			}
			else
			{
				if(
					$info['FIELD'] != 'USER_ID' && $info['FIELD'] != 'TASK_ID' && $info['FIELD'] != 'TYPE'
				)
				{
					continue;
				}

				if(is_array($info['VALUE']) && !empty($info['VALUE']))
				{
					$key = ($info['NOT'] ? '!' : '').'@ref.'.$info['FIELD'];
					$value = new SqlExpression(implode(', ', array_map(function($value) { return intval($value); }, $info['VALUE'])));
				}
				else
				{
					$key = CAllSQLWhere::getOperationByCode($info['OPERATION']).'ref.'.$info['FIELD'];
					$value = array('?', $info['VALUE']);
				}

				$conditions[$key] = $value;
			}
		}
	}

	return $conditions;
}

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