Files
mongo-php-driver/docs/api/MongoDB/Write/UpdateBatch.php
T
Jeremy Mikola 749b2d391a Implement review feedback
Some highlights: fix class/interface syntax; additional class/method docs; Manager convenience methods; more value objects.
2014-06-13 03:52:26 -04:00

37 lines
676 B
PHP

<?php
namespace MongoDB\Write;
/**
* Aggregates a collection of update operations, to be executed in batches.
*/
final class UpdateBatch implements WriteBatch
{
private $documents;
private $writeOptions;
/**
* @param array $writeOptions Ordering and write concern options
*/
public function __construct(array $writeOptions)
{
$this->writeOptions = $writeOptions;
}
/**
* @see WriteBatch::add()
*/
public function add($document)
{
$this->documents[] = $document;
}
/**
* @see Countable::count()
*/
public function count()
{
return count($this->documents);
}
}