- Модуль: landing
- Путь к файлу: ~/bitrix/modules/landing/lib/publicaction.php
- Класс: BitrixLandingPublicAction
- Вызов: PublicAction::restGateway
static function restGateway($fields, $t, $server)
{
// get context app
self::$restApp = AppTable::getByClientId($server->getClientId());
// prepare method and call action
$method = $server->getMethod();
$method = mb_substr($method, mb_strpos($method, '.') + 1);// delete module-prefix
$method = preg_replace('/./', '\', $method, substr_count($method, '.') - 1);
$method = str_replace('.', '::', $method);
$result = self::actionProcessing(
$method,
$fields,
true
);
// prepare answer
if ($result['type'] == 'error')
{
foreach ($result['result'] as $error)
{
throw new BitrixRestRestException(
$error['error_description'],
$error['error']
);
}
}
else
{
return $result['result'];
}
}