Method |
Description |
|
__call ( $name, $arguments ) |
|
|
__construct ( Collection $collection, array $data = null, array $options = [] ) |
|
|
__get ( $name ) |
|
|
__toString ( ) |
|
|
__unset ( $fieldName ) |
|
|
addRelation ( $relationName, Document $document ) |
|
|
addToSet ( $fieldName, $value ) |
|
|
addToSetEach ( $fieldName, array $values ) |
|
|
append ( type $selector, type $value ) : Structure |
If field not exist - set value. |
|
attachBehavior ( string $name, string | array | Sokil\Mongo\Behavior $behavior ) : Document |
|
|
attachBehaviors ( array $behaviors ) |
|
|
attachEvent ( string $event, callable | array | string $handler, $priority ) : Document |
Attach event handler |
|
beforeConstruct ( ) |
Event handler, called before running constructor. |
|
behaviors ( ) |
|
|
bitwiceAnd ( $field, $value ) |
|
|
bitwiceOr ( $field, $value ) |
|
|
bitwiceXor ( $field, $value ) |
|
|
clearBehaviors ( ) |
|
|
clearRevisions ( ) |
|
|
createReference ( ) : array |
Get reference to document |
|
decrement ( $fieldName, $value = 1 ) |
|
|
defineId ( MongoId | string $id ) : Document |
Used to define id of stored document. This id must be already present in db |
|
delete ( ) |
|
|
getCollection ( ) : Collection |
Get instance of collection |
|
getId ( ) |
|
|
getOperator ( ) |
|
|
getOption ( $name, $default = null ) |
|
|
getOptions ( ) |
|
|
getReferencedDocument ( string $name ) : null | Document |
Get document by reference |
|
getReferencedDocumentList ( string $name ) : null | Document |
Get document by reference |
|
getRelated ( string $relationName ) : array | Document |
Get related documents |
|
getRelationDefinition ( ) : array |
Relation definition through mapping is more prior to defined in class |
|
getRevision ( $id ) |
|
|
getRevisionManager ( ) : Sokil\Mongo\RevisionManager |
|
|
getRevisions ( $limit = null, $offset = null ) |
|
|
getRevisionsCount ( ) |
|
|
hasEvent ( string $event ) : boolean |
Check if event attached |
|
hasOption ( $name ) |
|
|
increment ( $fieldName, $value = 1 ) |
|
|
isModificationOperatorDefined ( ) |
|
|
isSaveRequired ( ) |
|
|
isStored ( ) |
|
|
merge ( array $data ) : Document |
|
|
pull ( integer | string | array | Expression | callable $expression, mixed | Expression | callable $value = null ) : Document |
Removes from an existing array all instances of a value or
values that match a specified query |
|
push ( string $fieldName, mixed $value ) : Document |
Push argument as single element to field value |
|
pushEach ( string $fieldName, array $values ) : Document |
Push each element of argument's array as single element to field value |
|
pushReference ( string $name, Document $document ) : Document |
Push reference to list |
|
refresh ( ) |
Reload data from db and reset all unsaved data |
|
removeRelation ( $relationName, Document $document = null ) |
|
|
reset ( ) : Document |
Reset all data passed to object in run-time, like events, behaviors,
data modifications, etc. to the state just after open or save document |
|
save ( $validate = true ) |
|
|
set ( string $fieldName, mixed $value ) : Document |
Update value in local cache and in DB |
|
setGeometry ( string $field, GeoJson\Geometry\Geometry $geometry ) : Document |
Set geo data as GeoJson object |
|
setGeometryCollection ( string $field, array $geometryCollection ) : Document |
Set collection of different geometries |
|
setId ( MongoId | string $id ) : Document |
Used to define id of not stored document. |
|
setLegacyPoint ( string $field, float $longitude, float $latitude ) : Document |
Set point as longitude and latitude in legacy format |
|
setLineString ( string $field, array $pointArray ) : Document |
Set line string as array of points |
|
setMultiLineString ( string $field, array $lineStringArray ) : Document |
Set multi line string as array of line strings |
|
setMultiPoint ( string $field, array $pointArray ) : Document |
Set multi point as array of points |
|
setMultyPolygon ( string $field, array $polygonsArray ) : Document |
Set multy polygon as array of polygons. |
|
setPoint ( string $field, float $longitude, float $latitude ) : Document |
Set point as longitude and latitude |
|
setPolygon ( string $field, array $lineRingsArray ) : Document |
Set polygon as array of line rings. |
|
setReference ( $name, Document $document ) : Document |
Store DBRef to specified field |
|
triggerEvent ( string $eventName, Event $event = null ) : Event |
Manually trigger defined events |
|
unsetField ( string $fieldName ) : Document |
Remove field |
|
validate ( ) : Document |
|
|