RecordWriteResult
final class RecordWriteResult (View source)
Outcome of a record write. Replaces the bool return plus MessageService side channel: callers read the reason, the refusal and the offending record part from here instead of the session.
Methods
An edit that passed validation and the permission checks in a preview, nothing written.
An edit that was written.
No description
A save that matched the stored record and was skipped, so nothing was written.
No description
No description
No description
No description
The backend answered and refused the write; $reason is its own sanitised text and $message already carries it.
Details
static RecordWriteResult
previewed(array|null $vacates, array $key)
An edit that passed validation and the permission checks in a preview, nothing written.
static RecordWriteResult
saved(array $key)
An edit that was written.
static RecordWriteResult
ok(int|string|null $recordId = null)
No description
static RecordWriteResult
unchanged()
A save that matched the stored record and was skipped, so nothing was written.
static RecordWriteResult
failure(string $message, Refusal $refusal = Refusal::INVALID_INPUT, RecordField|null $field = null)
No description
static RecordWriteResult
forbidden(string $message)
No description
static RecordWriteResult
notFound(string $message)
No description
static RecordWriteResult
backendFailure(string $message, RecordField|null $field = null)
No description
static RecordWriteResult
backendRejected(string $message, string $reason, RecordField|null $field = null)
The backend answered and refused the write; $reason is its own sanitised text and $message already carries it.