• Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/classes/general/logitem.php
  • Класс: CTaskLogItem
  • Вызов: CTaskLogItem::runRestMethod
static function runRestMethod($executiveUserId, $methodName, $args,
	/** @noinspection PhpUnusedParameterInspection */ $navigation)
{
	static $arManifest = null;
	static $arMethodsMetaInfo = null;

	if ($arManifest === null)
	{
		$arManifest = self::getManifest();
		$arMethodsMetaInfo = $arManifest['REST: available methods'];
	}

	// Check and parse params
	CTaskAssert::assert(isset($arMethodsMetaInfo[$methodName]));
	$arMethodMetaInfo = $arMethodsMetaInfo[$methodName];
	$argsParsed = CTaskRestService::_parseRestParams('ctasklogitem', $methodName, $args);

	$returnValue = null;
	if (isset($arMethodMetaInfo['staticMethod']) && $arMethodMetaInfo['staticMethod'])
	{
		if ($methodName === 'list')
		{
			$taskId = $argsParsed[0];
			$order = $argsParsed[1];
			$filter = $argsParsed[2];
			$oTaskItem = CTaskItem::getInstance($taskId, $executiveUserId);

			list($items, $rsData) = self::fetchList($oTaskItem, $order, $filter);

			$returnValue = array();
			foreach ($items as $item)
				$returnValue[] = $item->getData(false);
		}
		else
		{
			$returnValue = call_user_func_array(array('self', $methodName), $argsParsed);
		}
	}
	else
	{
		$taskId     = array_shift($argsParsed);
		$itemId     = array_shift($argsParsed);
		$oTaskItem  = CTaskItem::getInstance($taskId, $executiveUserId);
		$item  = new self($oTaskItem, $itemId);

		$returnValue = call_user_func_array(array($item, $methodName), $argsParsed);
	}

	return (array($returnValue, null));
}