• Модуль: landing
  • Путь к файлу: ~/bitrix/modules/landing/lib/publicaction.php
  • Класс: BitrixLandingPublicAction
  • Вызов: PublicAction::restBase
static function restBase()
{
	static $restMethods = array();

	if (empty($restMethods))
	{
		$restMethods[self::REST_SCOPE_DEFAULT] = array();
		$restMethods[self::REST_SCOPE_CLOUD] = array();

		$classes = array(
			self::REST_SCOPE_DEFAULT => array(
				'block', 'site', 'landing', 'repo', 'template',
				'demos', 'role', 'syspage', 'chat'
			),
			self::REST_SCOPE_CLOUD => array(
				'cloud'
			)
		);

		// then methods list for each class
		foreach ($classes as $scope => $classList)
		{
			foreach ($classList as $className)
			{
				$fullClassName = self::getNamespacePublicClasses() . '\' . $className;
				$class = new ReflectionClass($fullClassName);
				$methods = $class->getMethods(ReflectionMethod::IS_PUBLIC);
				foreach ($methods as $method)
				{
					$static = $method->getStaticVariables();
					if (!isset($static['internal']) || !$static['internal'])
					{
						$command = $scope.'.'.
							mb_strtolower($className).'.'.
							mb_strtolower($method->getName());
						$restMethods[$scope][$command] = array(
							__CLASS__, 'restGateway'
						);
					}
				}
			}
		}
	}

	return array(
		self::REST_SCOPE_DEFAULT => $restMethods[self::REST_SCOPE_DEFAULT],
		self::REST_SCOPE_CLOUD => $restMethods[self::REST_SCOPE_CLOUD]
	);
}