芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/.trash/cepali/cache/stores/mongodb/MongoDB/InsertOneResult.php
writeResult = $writeResult; $this->insertedId = $insertedId; $this->isAcknowledged = $writeResult->isAcknowledged(); } /** * Return the number of documents that were inserted. * * This method should only be called if the write was acknowledged. * * @see InsertOneResult::isAcknowledged() * @return integer * @throws BadMethodCallException is the write result is unacknowledged */ public function getInsertedCount() { if ($this->isAcknowledged) { return $this->writeResult->getInsertedCount(); } throw BadMethodCallException::unacknowledgedWriteResultAccess(__METHOD__); } /** * Return the inserted document's ID. * * If the document had an ID prior to inserting (i.e. the driver did not * need to generate an ID), this will contain its "_id". Any * driver-generated ID will be a MongoDB\BSON\ObjectId instance. * * @return mixed */ public function getInsertedId() { return $this->insertedId; } /** * Return whether this insert was acknowledged by the server. * * 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. * * @return boolean */ public function isAcknowledged() { return $this->writeResult->isAcknowledged(); } }