Doctrine\ORM\EntityManager::flush
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.
Signature
Parameters
$entity
— object
Errors/Exceptions
-
OptimisticLockException
- If a version check on an entity that