PreservedCollection uses ConstantsTrait
The name of the collection where the `preserve` action sets documents aside.
The name is derived, never chosen : <collection>__preserved. That is what
lets reinject find the documents set aside without being told where they are.
The double underscore keeps a collision with a real collection unlikely.
Tags
Table of Contents
Constants
- SUFFIX : string = '__preserved'
- The suffix appended to a collection name to name its backup.
Methods
- backupOf() : string
- The name of the backup of a collection.
- isBackup() : bool
- Indicates whether a collection name is the name of a backup.
Constants
SUFFIX
The suffix appended to a collection name to name its backup.
public
string
SUFFIX
= '__preserved'
Methods
backupOf()
The name of the backup of a collection.
public
static backupOf(string $collection) : string
Parameters
- $collection : string
-
The collection whose documents are set aside.
Return values
string —The backup name, <collection>__preserved.
isBackup()
Indicates whether a collection name is the name of a backup.
public
static isBackup(string $collection) : bool
Parameters
- $collection : string
-
The collection name to test.
Return values
bool —True when the name ends with SUFFIX.