Метод updateAuthorIdIfUnchanged

Расположение

Исходный файл метода в Bitrix Framework

Путь к исходному файлу строки 341–358
~/bitrix/modulesim/lib/model/chat.php

Исходный код

PHP
public static

Сигнатура метода

public static function updateAuthorIdIfUnchanged(int $chatId, int $expectedAuthorId, int $authorId): bool

Возвращает: bool

Описание

Writes the owner only while the owner is still $expectedAuthorId. The condition and the write are one statement on purpose: as a read and then a write they leave a window in which another request can choose an owner. update() carries no condition besides the primary key, so the write goes by filter, and the bookkeeping of the update event is applied by hand instead of being lost with it. $expectedAuthorId and $authorId must differ: a write of the value the row already holds is not a change, and this reports it as not applied.

Параметры

3
Имя Тип По умолчанию Флаги
$chatId int -
-
$expectedAuthorId int -
-
$authorId int -
-