• Модуль: transformer
  • Путь к файлу: ~/bitrix/modules/transformer/lib/command.php
  • Класс: BitrixTransformerCommand
  • Вызов: Command::save
public function save()
{
	if($this->id > 0)
	{
		throw new InvalidOperationException('command should not be saved before save');
	}
	$this->guid = self::generateGuid();
	$time = new DateTime();
	$time->setTime($time->format('H'), $time->format('i'), $time->format('s'));
	$this->time = $time;
	$commandItem = array(
		'GUID' => $this->guid,
		'STATUS' => $this->status,
		'COMMAND' => $this->command,
		'MODULE' => base64_encode(serialize($this->module)),
		'CALLBACK' => base64_encode(serialize($this->callback)),
		'PARAMS' => base64_encode(serialize($this->params)),
		'FILE' => $this->file,
		'UPDATE_TIME' => $this->time,
	);
	$addResult = CommandTable::add($commandItem);
	if($addResult->isSuccess())
	{
		$this->id = $addResult->getId();
	}
	return $addResult;
}