• Модуль: transformer
  • Путь к файлу: ~/bitrix/modules/transformer/lib/command.php
  • Класс: BitrixTransformerCommand
  • Вызов: Command::updateStatus
public function updateStatus($status, $error = '', $errorCode = 0)
{
	$status = intval($status);
	if(!self::getStatusText($status))
	{
		throw new ArgumentOutOfRangeException('status');
	}
	if($this->status >= $status)
	{
		throw new InvalidOperationException('new status should be greater than current');
	}
	if(!$this->id)
	{
		throw new InvalidOperationException('command should be saved before update');
	}
	Log::write('updateStatus in '.$this->guid.' from '.$this->status.' to '.$status);
	$this->status = $status;
	$data = array('STATUS' => $status, 'UPDATE_TIME' => new DateTime());
	if(!empty($error))
	{
		$data['ERROR'] = $error;
	}
	if(!empty($errorCode))
	{
		$errorCode = intval($errorCode);
		$data['ERROR_CODE'] = $errorCode;
	}
	return CommandTable::update($this->id, $data);
}