• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/dispatcher.php
  • Класс: BitrixTasksDOES
  • Вызов: DOES::getOperationsByPlan
protected function getOperationsByPlan($plan, $result)
{
	$bindings = array();

	/** @var ToDo $op */
	foreach($plan as $op)
	{
		if($op->isProcessed())
		{
			continue;
		}

		$action = $op->getAction();
		$code = $op->getCode();

		$opClassPrefix = '\Bitrix\Tasks\Dispatcher\';
		$opClass = $opClassPrefix.'Operation';
		$opArgs = array('NAMESPACE' => $this->rootNamespace);
		if(mb_substr($action, 0, 8) == 'runtime:')
		{
			$action = mb_substr($action, 8);
			if(!array_key_exists($action, $this->runtimeActions))
			{
				$result->getErrors()->add('ILLEGAL_RUNTIME_ACTION', 'Runtime action not found: '.$action, static::ERROR_TYPE_PARSE);
			}

			$opClass = $opClassPrefix.'RunTimeOperation';
			$opArgs['CALLABLE'] = $this->runtimeActions[$action];
		}

		if($result->isSuccess())
		{
			/** @var Operation $boundOp */
			$boundOp = new $opClass($op->export(), $opArgs);
			$boundOp->parse();

			$bindings[$code] = $boundOp;

			$result->getErrors()->load($boundOp->getErrors());
		}
	}

	return $bindings;
}