The `clear()` function in the PHP Doctrine ORM EntityManagerInterface is used to detach all entities from the EntityManager, which effectively clears the entire persistence context. This means that all entities currently managed by the EntityManager will no longer be managed, and any changes made to them will not be saved to the database upon flushing. This method is useful when you want to discard any changes made to entities within a specific unit of work.
PHP Doctrine\ORM EntityManagerInterface::clear - 15 examples found. These are the top rated real world PHP examples of Doctrine\ORM\EntityManagerInterface::clear extracted from open source projects. You can rate examples to help us improve the quality of examples.