Méthode |
Description |
|
__call ( string $name, array $parameters ) : EMongoDocument | mixed |
This, in addition to EMongoModels edition, will also call scopes on the model |
|
__construct ( string $scenario = 'insert' ) |
Sets up our model and set the field cache just like in EMongoModel |
|
aggregate ( array $pipeline ) : mixed |
This is an aggregate helper on the model
Note: This does not return the model but instead the result array directly from MongoDB. |
|
cache ( integer $duration, CCacheDependency | ICacheDependency $dependency = null, integer $queryCount = 1 ) : EMongoDocument |
Sets the parameters for query caching. |
|
collectionName ( ) : string |
Returns the collection name as a string |
|
count ( EMongoCriteria | array $criteria = [] ) : integer |
Count() allows you to count all the documents returned by a certain condition, it is analogous
to $db->collection->find()->count() and basically does exactly that. |
|
defaultScope ( ) : array |
Sets the default scope |
|
delete ( ) : boolean |
Deletes this record |
|
deleteAll ( array | EMongoCriteria $criteria = [], array $options = [] ) : mixed |
Delete all records matching a criteria |
|
deleteByPk ( string | MongoId $pk, array | EMongoCriteria $criteria = [], array $options = [] ) : mixed |
Delete record by pk |
|
distinct ( string $key, array $query = [] ) : mixed |
A distinct helper on the model, this is not the same as the aggregation framework
distinct |
|
ensureIndexes ( unknown $indexes ) |
Allows a user to ensure a number of indexes using the format: |
|
equals ( EMongoDocument $record ) : boolean |
Compares current active record with another one. |
|
exists ( array $criteria = [] ) : boolean |
Checks if a record exists in the database |
|
find ( array | EMongoCriteria $criteria = [], array | string[] $fields = [] ) : EMongoCursor | EMongoDocument[] |
Find some records |
|
findAll ( array $criteria = [], array | string[] $fields = [] ) : EMongoCursor | EMongoDocument[] |
Alias of find |
|
findAllByAttributes ( array $criteria = [], array | string[] $fields = [] ) : EMongoCursor | EMongoDocument[] |
Alias of find |
|
findAllByPk ( mixed $pk, array | string[] $fields = [] ) : EMongoCursor | EMongoDocument[] |
Finds all records based on $pk |
|
findAndModify ( $criteria = [], $updateDoc = [], $fields = [], $options = [] ) : null | EMongoDocument |
Find one record, modifies, and returns it. |
|
findByPk ( string | MongoId $pk, array | string[] $fields = [] ) : EMongoDocument | null |
An alias for findBy_id() that relates to Yiis own findByPk |
|
findBy_id ( string | MongoId $_id, array | string[] $fields = [] ) : EMongoDocument | null |
Finds one by _id |
|
findOne ( array | EMongoCriteria $criteria = [], array | string[] $fields = [] ) : EMongoDocument | null |
Find one record |
|
getAttributeLabel ( string $attribute ) : string |
Returns the text label for the specified attribute. |
|
getCollection ( ) : MongoCollection |
Gets the collection for this model |
|
getDbCriteria ( boolean $createIfNull = true ) : array |
gets and if null sets the db criteria for this model |
|
getIsNewRecord ( ) : boolean |
Returns if the current record is new. |
|
getLastError ( ) : array |
A bit deceptive, this actually gets the last response from either save() or update(). The reason it is called this
is because MongoDB calls it this and so it seems better to have unity on that front. |
|
getLatest ( ) : null | EMongoDocument |
Is basically a find one of the last version to be saved |
|
getMongoId ( string | MongoId $value = null ) : MongoId |
Returns MongoId based on $value |
|
getPrimaryKey ( string | MongoId $value = null ) : MongoId |
Returns the value of the primary key |
|
getProjectedFields ( ) : array | string[] |
Gets a list of the projected fields for the model |
|
incrementVersion ( ) : boolean |
Forceably increments the version of this document |
|
insert ( array $attributes = null ) : boolean |
Inserts this record |
|
mapreduce ( MongoCode $map, MongoCode $reduce, MongoCode $finalize = null, array $out = [], array $query = [], array $options = [] ) : mixed |
A mapreduce helper for this model |
|
mergeCriteria ( array $oldCriteria, array $newCriteria ) : array |
Merges two criteria objects. Best used for scopes |
|
mergeDbCriteria ( array | EMongoCriteria $newCriteria ) : array |
Merges the current DB Criteria with the inputted one |
|
model ( string $className = __CLASS__ ) : EMongoDocument |
Returns the static model of the specified AR class. |
|
onAfterDelete ( CEvent $event ) |
|
|
onAfterFind ( CEvent $event ) |
|
|
onAfterSave ( CEvent $event ) |
|
|
onBeforeDelete ( CEvent $event ) |
|
|
onBeforeFind ( CEvent $event ) |
|
|
onBeforeSave ( CEvent $event ) |
|
|
populateRecord ( array $attributes, boolean $callAfterFind = true, boolean $partial = false ) : EMongoDocument | null |
Creates an active record with the given attributes. |
|
populateRecords ( array $data, boolean $callAfterFind = true, string $index = null ) : array |
Returns an array of records populated by incoming data |
|
refresh ( ) : boolean |
Refreshes the data from the database |
|
resetScope ( boolean $resetDefault = true ) : EMongoDocument |
Resets the scopes applied to the model clearing the _criteria variable |
|
save ( boolean $runValidation = true, array $attributes = null ) : boolean |
Saves this record |
|
saveAttributes ( array $attributes ) : boolean |
Saves only a specific subset of attributes as defined by the param |
|
saveCounters ( array $counters, null $lower = null, null $upper = null ) : boolean |
|
|
scopes ( ) : array |
The scope attached to this model |
|
search ( array $query = [], array $project = [], boolean $partialMatch = false, array $sort = [] ) : EMongoDataProvider |
Gives basic searching abilities for things like CGridView |
|
setAttribute ( string $name, mixed $value ) : boolean |
Sets the attribute of the model |
|
setDbCriteria ( array $criteria ) : array |
Sets the db criteria for this model |
|
setIsNewRecord ( boolean $value ) |
Sets if the record is new. |
|
setProjectedFields ( array $fields ) |
Sets the projected fields of the model |
|
setVersion ( mixed $n ) : boolean |
Forceably sets the version of this document |
|
trace ( string $func ) |
Produces a trace message for functions in this class |
|
update ( array $attributes = null ) : boolean |
Updates this record |
|
updateAll ( array | EMongoCriteria $criteria = [], array $updateDoc = [], array $options = ['multiple' => true] ) : boolean |
Update all records matching a criteria |
|
updateByPk ( string | MongoId $pk, array $updateDoc = [], array | EMongoCriteria $criteria = [], array $options = [] ) : boolean |
Update record by PK |
|
version ( ) : string |
Gets the version of this document |
|
versionField ( ) : string |
Denotes the field tob e used to house the version number |
|
versioned ( ) : boolean |
Denotes whether or not this document is versioned |
|