UpdateDateModel
Contract for models able to touch a single date property of a document.
An UpdateDateModel exposes a UpdateDateModel::updateDate() operation
that stamps one date field of a document with the current date — by default
the modified property (Schema::MODIFIED). It is the lightweight way to
record a "last touched" timestamp without rewriting the rest of the document.
Tags
Table of Contents
Methods
- updateDate() : mixed
- Updates a single date property in a document with the current date.
Methods
updateDate()
Updates a single date property in a document with the current date.
public
updateDate([array<string|int, mixed> $init = [] ][, string $property = Schema::MODIFIED ]) : mixed
By default, it updates the modified property with the current timestamp.
Parameters
- $init : array<string|int, mixed> = []
-
Operation options identifying the target document, typically a
key/id, an explicitvalueto use instead of "now", optionalbindsand a return clause. - $property : string = Schema::MODIFIED
-
The document property to update (default: Schema::MODIFIED).
Tags
Return values
mixed —The updated document (or operation result), depending on the implementation.