Doctrine\Common\Persistence\ObjectManager::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.
Signature
public function flush()