ReloadWrittenDocumentTrait uses \oihana\controllers\traits\ModelCallTrait, \oihana\models\traits\ModelTrait, \oihana\controllers\traits\prepare\PrepareLang, \oihana\controllers\traits\prepare\PrepareSkin
Re-reads the document a write has just produced, so the response carries what the database holds rather than what the caller sent — computed values, `modified`, i18n and defaults included.
It is a read, and it is treated as one. Both write handlers used to build
this call by hand, from four keys, outside the ModelCallTrait hooks: the
request authorizer never reached it, so
isAuthorized() fell open and a field hidden
by Field::REQUIRES came straight back in the write response — the very value the
matching GET refuses. Stating the call once, here, is what keeps the two
responses of the same controller in agreement.
Arango::RAW never reaches this method: it returns the write's own result and
skips the reload entirely, so no projection applies to it. That opt-out is
declared in the route, never by a client, and it is incompatible with a
projection gate.
Tags
Table of Contents
Methods
- reload() : mixed
- Re-reads a written document through the lifecycle hooks.
Methods
reload()
Re-reads a written document through the lifecycle hooks.
protected
reload(ServerRequestInterface|null $request, array<string|int, mixed> $args, array<string|int, mixed> $init, object $document, string $method) : mixed
Parameters
- $request : ServerRequestInterface|null
-
The current PSR-7 request.
- $args : array<string|int, mixed>
-
The route placeholders, forwarded as
Arango::ARGS. - $init : array<string|int, mixed>
-
The caller init the lang / skin are read from.
- $document : object
-
The document the write returned.
- $method : string
-
The HTTP method, for the per-verb skin default.
Return values
mixed —The reloaded document, after ModelCallTrait::afterModelCall().