PHP Class Phalcon\Db\Adapter\MongoDB\Functions

Afficher le fichier Open project: phalcon/incubator Class Usage Examples

Méthodes publiques

Méthode Description
extractIdFromInsertedDocument ( array | object $document ) : mixed Extracts an ID from an inserted document.
generateIndexName ( array | object $document ) : string Generate an index name from a key specification.
isFirstKeyOperator ( array | object $document ) : boolean Return whether the first key in the document starts with a "$" character.
isLastPipelineOperatorOut ( array $pipeline ) : boolean Return whether the aggregation pipeline ends with an $out operator.
isStringArray ( $input ) : boolean
readConcernAsDocument ( MongoDB\Driver\ReadConcern $readConcern ) : stdClass Converts a ReadConcern instance to a stdClass for use in a BSON document.
serverSupportsFeature ( MongoDB\Driver\Server $server, integer $feature ) : boolean Return whether the server supports a particular feature.

Method Details

extractIdFromInsertedDocument() public static méthode

This function is used when BulkWrite::insert() does not return a generated ID, which means that the ID should be fetched from an array offset, public property, or in the data returned by bsonSerialize().
See also: https://jira.mongodb.org/browse/PHPC-382
public static extractIdFromInsertedDocument ( array | object $document ) : mixed
$document array | object Inserted document
Résultat mixed

generateIndexName() public static méthode

Generate an index name from a key specification.
public static generateIndexName ( array | object $document ) : string
$document array | object Document containing fields mapped to values, which denote order or an index type
Résultat string

isFirstKeyOperator() public static méthode

This is used for differentiating update and replacement documents.
public static isFirstKeyOperator ( array | object $document ) : boolean
$document array | object Update or replacement document
Résultat boolean

isLastPipelineOperatorOut() public static méthode

This is used for determining whether the aggregation pipeline msut be executed against a primary server.
public static isLastPipelineOperatorOut ( array $pipeline ) : boolean
$pipeline array List of pipeline operations
Résultat boolean

isStringArray() public static méthode

public static isStringArray ( $input ) : boolean
$input
Résultat boolean

readConcernAsDocument() public static méthode

Converts a ReadConcern instance to a stdClass for use in a BSON document.
See also: https://jira.mongodb.org/browse/PHPC-498
public static readConcernAsDocument ( MongoDB\Driver\ReadConcern $readConcern ) : stdClass
$readConcern MongoDB\Driver\ReadConcern Read concern
Résultat stdClass

serverSupportsFeature() public static méthode

Return whether the server supports a particular feature.
public static serverSupportsFeature ( MongoDB\Driver\Server $server, integer $feature ) : boolean
$server MongoDB\Driver\Server Server to check
$feature integer Feature constant (i.e. wire protocol version)
Résultat boolean