ExistModel
Contract for models able to test the existence of a document.
An ExistModel answers a single yes/no question: does a document matching the
supplied options exist in the underlying storage? It is typically used as a
lightweight guard before a heavier read or write, and is the base interface
extended by GetModel and LastModel.
Tags
Table of Contents
Methods
- exist() : bool
- Indicates whether a document matching the given options exists.
Methods
exist()
Indicates whether a document matching the given options exists.
public
exist([array<string|int, mixed> $init = [] ]) : bool
Parameters
- $init : array<string|int, mixed> = []
-
Operation options identifying the document to test, typically a
key/idvalue, a set ofconditionsand theirbinds.
Tags
Return values
bool —true if at least one matching document exists, otherwise false.