RecordWriteResult
final class RecordWriteResult (View source)
Outcome of a record write. Replaces the bool return plus MessageService side channel: callers read the reason, the HTTP status and the offending form field from here instead of the session.
Constants
| FIELD_NAME |
|
| FIELD_CONTENT |
|
| FIELD_TTL |
|
| FIELD_PRIO |
|
| FIELD_DUPLICATE |
|
Methods
static RecordWriteResult
ok(int|string|null $recordId = null)
No description
static RecordWriteResult
failure(string $message, int $status = 400, string|null $field = null)
No description
static RecordWriteResult
forbidden(string $message)
No description
static RecordWriteResult
notFound(string $message)
No description
static RecordWriteResult
backendFailure(string $message)
No description
static string
fieldForMessage(string $message)
Validators report a message, not a field; this keeps the one heuristic the forms used to carry each, until ValidationResult names the field itself.
Details
static RecordWriteResult
ok(int|string|null $recordId = null)
No description
static RecordWriteResult
failure(string $message, int $status = 400, string|null $field = null)
No description
static RecordWriteResult
forbidden(string $message)
No description
static RecordWriteResult
notFound(string $message)
No description
static RecordWriteResult
backendFailure(string $message)
No description
static string
fieldForMessage(string $message)
Validators report a message, not a field; this keeps the one heuristic the forms used to carry each, until ValidationResult names the field itself.