Dispatcher::addReasons

  1. Bitrix24 API (v. 23.675.0)
  2. tasks
  3. Dispatcher
  4. addReasons
  • Модуль: tasks
  • Путь к файлу: ~/bitrix/modules/tasks/lib/dispatcher.php
  • Класс: BitrixTasksDispatcher
  • Вызов: Dispatcher::addReasons
static function addReasons(DispatcherOperation $operation, array $reasons, $reasonPrefix = '')
{
	$errors = $operation->getErrors();

	if((string) $reasonPrefix != '')
	{
		$reasonPrefix = '_'.$reasonPrefix;
	}

	foreach($reasons as $reason)
	{
		if(is_string($reason))
		{
			$errors->add($reasonPrefix.'REASON', $reason);
		}
		else
		{
			if((string) $reason['MESSAGE'] != '')
			{
				$code = ((string) $reason['CODE'] != '' ? $reason['CODE'] : $reasonPrefix.'REASON');
				$errors->add($code, $reason['MESSAGE']);
			}
		}
	}
}

Добавить комментарий