Method | Description | |
---|---|---|
attributes ( ) : array | Returns the list of all attribute names of the model. | |
collectionName ( ) : string | array | Declares the name of the Mongo collection associated with this AR class. | |
delete ( ) : integer | boolean | Deletes the document corresponding to this active record from the collection. | |
deleteAll ( array $condition = [], array $options = [] ) : integer | Deletes documents in the collection using the provided conditions. | |
equals ( |
Returns a value indicating whether the given active record is the same as the current one. | |
find ( ) : |
||
getCollection ( ) : |
Return the Mongo collection instance for this AR class. | |
getDb ( ) : |
Returns the Mongo connection used by this AR class. | |
insert ( boolean $runValidation = true, array $attributes = null ) : boolean | Inserts a row into the associated Mongo collection using the attribute values of this record. | |
primaryKey ( ) : string[] | Returns the primary key name(s) for this AR class. | |
toArray ( array $fields = [], array $expand = [], $recursive = true ) | ||
updateAll ( array $attributes, array $condition = [], array $options = [] ) : integer | Updates all documents in the collection using the provided attribute values and conditions. | |
updateAllCounters ( array $counters, array $condition = [], array $options = [] ) : integer | Updates all documents in the collection using the provided counter changes and conditions. |
Method | Description | |
---|---|---|
deleteInternal ( ) | ||
insertInternal ( $attributes = null ) | ||
updateInternal ( $attributes = null ) |
Method | Description | |
---|---|---|
dumpBsonObject ( MongoDB\BSON\Type $object ) : array | string | Converts MongoDB BSON object to readable value. | |
toArrayInternal ( mixed $data ) : array | Converts data to array recursively, converting MongoDB BSON objects to readable values. |
public attributes ( ) : array | ||
return | array | list of attribute names. |
public static collectionName ( ) : string | array | ||
return | string | array | the collection name |
public static deleteAll ( array $condition = [], array $options = [] ) : integer | ||
$condition | array | description of the objects to delete. Please refer to [[Query::where()]] on how to specify this parameter. |
$options | array | list of options in format: optionName => optionValue. |
return | integer | the number of documents deleted. |
public static find ( ) : |
||
return | the newly created [[ActiveQuery]] instance. |
public static getCollection ( ) : |
||
return | collection instance. |
public static getDb ( ) : |
||
return | the database connection used by this AR class. |
public insert ( boolean $runValidation = true, array $attributes = null ) : boolean | ||
$runValidation | boolean | whether to perform validation before saving the record. If the validation fails, the record will not be inserted into the collection. |
$attributes | array | list of attributes that need to be saved. Defaults to null, meaning all attributes that are loaded will be saved. |
return | boolean | whether the attributes are valid and the record is inserted successfully. |
public static primaryKey ( ) : string[] | ||
return | string[] | the primary keys of the associated Mongo collection. |
public static updateAll ( array $attributes, array $condition = [], array $options = [] ) : integer | ||
$attributes | array | attribute values (name-value pairs) to be saved into the collection |
$condition | array | description of the objects to update. Please refer to [[Query::where()]] on how to specify this parameter. |
$options | array | list of options in format: optionName => optionValue. |
return | integer | the number of documents updated. |
public static updateAllCounters ( array $counters, array $condition = [], array $options = [] ) : integer | ||
$counters | array | the counters to be updated (attribute name => increment value). Use negative values if you want to decrement the counters. |
$condition | array | description of the objects to update. Please refer to [[Query::where()]] on how to specify this parameter. |
$options | array | list of options in format: optionName => optionValue. |
return | integer | the number of documents updated. |