• Модуль: timeman
  • Путь к файлу: ~/bitrix/modules/timeman/lib/controller/worktime.php
  • Класс: BitrixTimemanControllerWorktime
  • Вызов: Worktime::decorateServiceResult
private function decorateServiceResult(WorktimeServiceResult $result)
{
	if (!$result->isSuccess())
	{
		$error = $result->getFirstError();
		if ($error && !empty($error->getCustomData()) && !empty($error->getCustomData()['reasonCode']))
		{
			$code = $error->getCustomData()['reasonCode'];
			if ($code === WorktimeServiceResult::ERROR_EMPTY_ACTIONS)
			{
				return new Error('Can not perform such an action for this user');
			}
			return new Error('', $code);
		}
		return $result->getErrors();
	}
	return $this->convertKeysToCamelCase($result->getWorktimeRecord()->collectRawValues());
}