프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$_classes | |||
$_commands |
메소드 | 설명 | |
---|---|---|
get ( $type, $export, array $options = [] ) | ||
toCommand ( $changes ) |
메소드 | 설명 | |
---|---|---|
_append ( array $changes, string $key, mixed $value, string $change ) : array | Handles appending nested objects to document changesets. | |
_create ( $export, array $options ) | ||
_diff ( array $left, array $right ) : array | Handle diffing operations between Document object states. Implemented because all of PHP's array comparison functions are broken when working with objects. | |
_update ( array $export ) : array | Calculates changesets for update operations, and produces an array which can be converted to a set of native MongoDB update operations. |
protected static _append ( array $changes, string $key, mixed $value, string $change ) : array | ||
$changes | array | The full set of changes to be made to the database. |
$key | string | The key of the field to append, which may be a dot-separated path if the value is or is contained within a nested object. |
$value | mixed | The value to append to the changeset. Can be a scalar value, array, a nested object, or part of a nested object. |
$change | string | The type of change, as to whether update/remove or rename etc. |
리턴 | array | Returns the value of `$changes`, with any new changed values appended. |
protected static _update ( array $export ) : array | ||
$export | array | An array of fields exported from a call to `Document::export()`, and should contain the following keys: - `'data'` _array_: An array representing the original data loaded from the database for the document. - `'update'` _array_: An array representing the current state of the document, containing any modifications made. - `'key'` _string_: If this is a nested document, this is a dot-separated path from the root-level document. |
리턴 | array | Returns an array representing the changes to be made to the document. These are converted to database-native commands by the `toCommand()` method. |