commit() public method

The operations are executed in the following order: 1) All entity insertions 2) All entity updates 3) All collection deletions 4) All collection updates 5) All entity deletions
public commit ( )
Example #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.
  *
  * If an entity is explicitly passed to this method only this entity and
  * the cascade-persist semantics + scheduled inserts/removals are synchronized.
  *
  * @param null|object|array $entity
  *
  * @return void
  *
  * @throws \Doctrine\ORM\OptimisticLockException If a version check on an entity that
  *         makes use of optimistic locking fails.
  */
 public function flush($entity = null)
 {
     $this->errorIfClosed();
     $this->unitOfWork->commit($entity);
 }
 /**
  * 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.
  *
  * @throws \Doctrine\ORM\OptimisticLockException If a version check on an entity that
  *         makes use of optimistic locking fails.
  */
 public function flush()
 {
     $this->errorIfClosed();
     $this->unitOfWork->commit();
 }