DeleteAllModel
Contract for models able to delete a set of documents in one call.
A DeleteAllModel exposes a single DeleteAllModel::deleteAll() operation
that removes every document matching the supplied options — or the whole
collection when no filter is given. Unlike TruncateModel::truncate(),
which empties the storage wholesale, deleteAll() runs an actual delete query
and may therefore honour conditions and return the affected documents.
Tags
Table of Contents
Methods
- deleteAll() : mixed
- Deletes a set of documents in the model.
Methods
deleteAll()
Deletes a set of documents in the model.
public
deleteAll([array<string|int, mixed> $init = [] ]) : mixed
Parameters
- $init : array<string|int, mixed> = []
-
Operation options scoping the deletion, typically a set of
conditionswith theirbindsand an optional return clause. An empty array removes every document.
Tags
Return values
mixed —The deleted documents or an operation result, depending on the
implementation (commonly an object, an array, or null).