PHP Class Phalcon\Db\Adapter\MongoDB\InsertOneResult

Afficher le fichier Open project: phalcon/incubator

Méthodes publiques

Méthode Description
__construct ( MongoDB\Driver\WriteResult $writeResult, mixed $insertedId ) Constructor.
getInsertedCount ( ) : integer Return the number of documents that were inserted.
getInsertedId ( ) : mixed Return the inserted document's ID.
isAcknowledged ( ) : boolean Return whether this insert was acknowledged by the server.

Method Details

__construct() public méthode

Constructor.
public __construct ( MongoDB\Driver\WriteResult $writeResult, mixed $insertedId )
$writeResult MongoDB\Driver\WriteResult
$insertedId mixed

getInsertedCount() public méthode

This method should only be called if the write was acknowledged.
See also: InsertOneResult::isAcknowledged()
public getInsertedCount ( ) : integer
Résultat integer

getInsertedId() public méthode

If the document already an ID prior to insertion (i.e. the driver did not need to generate an ID), this will contain its "_id". Any driver-generated ID will be an MongoDB\BSON\ObjectID instance.
public getInsertedId ( ) : mixed
Résultat mixed

isAcknowledged() public méthode

If the insert was not acknowledged, other fields from the WriteResult (e.g. insertedCount) will be undefined. If the insert was not acknowledged, other fields from the WriteResult (e.g. insertedCount) will be undefined and their getter methods should not be invoked.
public isAcknowledged ( ) : boolean
Résultat boolean