• Модуль: rest
  • Путь к файлу: ~/bitrix/modules/rest/classes/general/rest.php
  • Класс: CRestServer
  • Вызов: CRestServer::getMethodDescription
private function getMethodDescription()
{
	if(!$this->scope)
	{
		foreach($this->arServiceDesc as $scope => $arMethods)
		{
			if(array_key_exists($this->method, $arMethods))
			{
				$this->scope = $scope;
				break;
			}
		}
	}

	if(!isset($this->arServiceDesc[$this->scope]) || !isset($this->arServiceDesc[$this->scope][$this->method]))
	{
		foreach(GetModuleEvents('rest', 'onFindMethodDescription', true) as $event)
		{
			$result = ExecuteModuleEventEx($event, array($this->method, $this->scope));
			if(is_array($result))
			{
				if(!is_array($this->arServiceDesc[$result['scope']]))
				{
					$this->arServiceDesc[$result['scope']] = array();
				}

				$this->scope = $result['scope'];

				$this->arServiceDesc[$this->scope][$this->method] = $result;

				return $result;
			}
		}
	}

	return $this->arServiceDesc[$this->scope][$this->method];
}