UpdateModel
Contract for models able to update an existing document.
An UpdateModel exposes a single UpdateModel::update() operation that
applies a partial change to an existing document, merging the supplied fields
into the stored one. For a full document overwrite, see ReplaceModel.
Tags
Table of Contents
Methods
- update() : mixed
- Updates an existing document in the model.
Methods
update()
Updates an existing document in the model.
public
update([array<string|int, mixed> $init = [] ]) : mixed
Parameters
- $init : array<string|int, mixed> = []
-
Operation options carrying the change to apply, typically the target
key/id, thedocumentpatch to merge, optionalbindsand a return clause.
Tags
Return values
mixed —The updated document (or its result), depending on the implementation.