Files
mongo-php-driver/docs/api/MongoDB/GeneratedId.php
Jeremy Mikola 226a32985a PHP-1136: Allow custom cursor classes from command/query results
This commit also restructures the namespaces and some write method APIs.
2014-07-11 15:06:00 -04:00

46 lines
899 B
PHP

<?php
namespace MongoDB;
/**
* Value object for a document identifier that was generated by the driver or
* server during an insert or upsert operation, respectively.
*/
final class GeneratedId
{
private $id;
private $index;
/**
* Constructs a new GeneratedId
*
* @param mixed $id Document identifier
* @param integer $index Batch index of the corresponding operation
*/
public function __construct($id, $index)
{
$this->id = $id;
$this->index = (integer) $index;
}
/**
* Returns the GeneratedId
*
* @return mixed Document identifier
*/
public function getId()
{
return $this->id;
}
/**
* Returns the batch index
*
* @return integer Batch index of the corresponding operation
*/
public function getIndex()
{
return $this->index;
}
}