• Модуль: sender
  • Путь к файлу: ~/bitrix/modules/sender/lib/internals/queue.php
  • Класс: Bitrix\Sender\Internals\Queue
  • Вызов: Queue::save
public function save()
{
	$sqlHelper = Application::getConnection()->getSqlHelper();
	$type = $sqlHelper->forSql($this->type);
	$id = $sqlHelper->forSql($this->id);
	$item = $sqlHelper->forSql($this->current());
	if ($item)
	{
		$tableName = QueueTable::getTableName();
		$sql = "INSERT IGNORE $tableName(ENTITY_TYPE, ENTITY_ID, LAST_ITEM) "
			. "VALUES('$type', '$id', '$item') "
			. "ON DUPLICATE KEY UPDATE LAST_ITEM = '$item' ";
		Application::getConnection()->query($sql);
	}
	else
	{
		$this->delete();
	}

	return $this;
}