Files
mongo-php-driver/docs/api/MongoDB/Write/UpdateBatch.php
Hannes Magnusson f277d731e9 Add descriptions
2014-06-19 11:17:16 -07:00

33 lines
682 B
PHP

<?php
namespace MongoDB\Write;
/**
* Aggregates a collection of update operations, to be executed in batches.
*/
final class UpdateBatch implements WriteBatch
{
private $documents;
/**
* Adds a new operation to be executed
*
* @param array|object $document Operation/document to add to the batch
* @return UpdateBatch
*/
public function add($document)
{
$this->documents[] = $document;
}
/**
* Returns how many items have been added to this batch
*
* @return int How many operations are total in this batch object
*/
public function count()
{
return count($this->documents);
}
}