• Модуль: intranet
  • Путь к файлу: ~/bitrix/modules/intranet/lib/userqueue.php
  • Класс: BitrixIntranetUserQueue
  • Вызов: UserQueue::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)
	{
		$class = static::getDataManagerClass();
		$tableName = $class::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;
}