Task::getAccessibleMyTasksQuery

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. Task
  4. getAccessibleMyTasksQuery
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/internals/runtime/task.php
  • Класс: BitrixTasksInternalsRunTimeTask
  • Вызов: Task::getAccessibleMyTasksQuery
static function getAccessibleMyTasksQuery($parameters, $filter, $runtimeOptions)
{
	$memberReferenceFilter = [
		'=ref.TASK_ID' => 'this.ID',
		'=ref.USER_ID' => ['?', $parameters['USER_ID']]
	];

	if ($parameters['APPLY_MEMBER_FILTER'] ?? null)
	{
		$memberCondition = static::getMemberConditions($parameters['APPLY_MEMBER_FILTER'], $parameters);
		$memberReferenceFilter = array_merge($memberReferenceFilter, $memberCondition[0]);
	}

	$memberReference = new EntityReferenceField(
		'TM',
		MemberTable::getEntity(),
		[$memberReferenceFilter],
		['join_type' => 'inner']
	);

	$query = new EntityQuery(TaskTable::getEntity());
	$query->setSelect(['TASK_ID' => 'ID']);
	$query->registerRuntimeField('', $memberReference);

	$query = static::setRuntimeOptionsForQuery($runtimeOptions, $query);

	if (!empty($filter))
	{
		$query->setFilter($filter);
	}

	return $query->getQuery();
}

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