Метод asOneWrite

private

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

private function asOneWrite(?ProviderPayload $payload, Closure $write): mixed

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

Описание

Runs a write of the row that needs a second statement inside one transaction, and a write that needs only one statement without any: `SETTINGS` is the one column that cannot travel with the rest ({@see self::writeSettings()}), so a write carrying it is the only write of this boundary made of two statements, and the only one where a failure of the second would leave half a row behind - an activity without the settings of its provider on an add, an update answering success over a column that never got there. Legacy has no transaction because legacy needs none: it writes the column in the same statement as the rest. NESTING IS THE NORMAL CASE, not the exception, and both drivers of the portal express it with a savepoint (`MysqlCommonConnection::startTransaction()`, `PgsqlConnection::startTransaction()`): a write of an activity happens inside whatever transaction its caller opened, and a rollback here undoes this pair alone.

Параметры

2
Имя Тип По умолчанию Флаги
$payload ?ProviderPayload —
—
$write Closure —
—

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

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

Путь к исходному файлу Source
~/bitrix/modulescrm/lib/V2/Internal/Repository/Activity/ActivityRepository.php
Расположение метода в файле
Строки 860–884

Исходный код

PHP