PHP Class Phalcon\Db\Adapter\MongoDB\UpdateResult

Show file Open project: phalcon/incubator

Public Methods

Method Description
__construct ( MongoDB\Driver\WriteResult $writeResult ) Constructor.
getMatchedCount ( ) : integer Return the number of documents that were matched by the filter.
getModifiedCount ( ) : integer | null Return the number of documents that were modified.
getUpsertedCount ( ) : integer Return the number of documents that were upserted.
getUpsertedId ( ) : mixed | null Return the ID of the document inserted by an upsert operation.
isAcknowledged ( ) : boolean Return whether this update was acknowledged by the server.

Method Details

__construct() public method

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

getMatchedCount() public method

This method should only be called if the write was acknowledged.
See also: UpdateResult::isAcknowledged()
public getMatchedCount ( ) : integer
return integer

getModifiedCount() public method

This value is undefined (i.e. null) if the write executed as a legacy operation instead of command. This method should only be called if the write was acknowledged.
See also: UpdateResult::isAcknowledged()
public getModifiedCount ( ) : integer | null
return integer | null

getUpsertedCount() public method

This method should only be called if the write was acknowledged.
See also: UpdateResult::isAcknowledged()
public getUpsertedCount ( ) : integer
return integer

getUpsertedId() public method

This value is undefined (i.e. null) if an upsert did not take place. This method should only be called if the write was acknowledged.
See also: UpdateResult::isAcknowledged()
public getUpsertedId ( ) : mixed | null
return mixed | null

isAcknowledged() public method

If the update was not acknowledged, other fields from the WriteResult (e.g. matchedCount) will be undefined and their getter methods should not be invoked.
public isAcknowledged ( ) : boolean
return boolean