• Модуль: calendar
  • Путь к файлу: ~/bitrix/modules/calendar/classes/general/calendar_restservice.php
  • Класс: CCalendarRestService
  • Вызов: CCalendarRestService::EventGetById
static function EventGetById($params = [], $nav = null, $server = null)
{
	$methodName = "calendar.event.getbyid";

	if (empty($params['id']))
	{
		throw new RestException(Loc::getMessage('CAL_REST_PARAM_EXCEPTION', [
			'#PARAM_NAME#' => 'id',
			'#REST_METHOD#' => $methodName
		]));
	}

	if (Loader::includeModule('intranet') && !BitrixIntranetUtil::isIntranetUser())
	{
		throw new RestException(Loc::getMessage('CAL_REST_ACCESS_DENIED'));
	}

	$event = CCalendarEvent::GetById($params['id']);
	unset($event['ACTIVE'], $event['DT_FROM'], $event['DT_TO'], $event['TEXT_COLOR']);

	return $event ?: null;
}