commit() public méthode

The operations are executed in the following order: 1) All document insertions 2) All document updates 3) All document deletions
public commit ( object $document = null, array $options = [] )
$document object
$options array Array of options to be used with batchInsert(), update() and remove()
Exemple #1
0
 /**
  * Flushes all changes to objects that have been queued up to now to the database.
  * This effectively synchronizes the in-memory state of managed objects with the
  * database.
  *
  * @param object $document
  * @param array $options Array of options to be used with batchInsert(), update() and remove()
  */
 public function flush($document = null, array $options = array())
 {
     if (null !== $document && !is_object($document) && !is_array($document)) {
         throw new \InvalidArgumentException(gettype($document));
     }
     $this->errorIfClosed();
     $this->unitOfWork->commit($document, $options);
 }
 /**
  * Flushes all changes to objects that have been queued up to now to the database.
  * This effectively synchronizes the in-memory state of managed objects with the
  * database.
  *
  * @param array $options Array of options to be used with batchInsert(), update() and remove()
  */
 public function flush(array $options = array())
 {
     $this->errorIfClosed();
     $this->unitOfWork->commit($options);
 }