Skip to content

Commit

Permalink
Merge pull request #2 from LordWeedlle/2.5.1
Browse files Browse the repository at this point in the history
[REVIEW] Throw an exception if trying to flush a single entity
  • Loading branch information
sandvige authored Oct 16, 2018
2 parents d32ce7f + 95778d9 commit dfbadfd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/Doctrine/ORM/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,14 @@ public function createQueryBuilder()
*
* @throws \Doctrine\ORM\OptimisticLockException If a version check on an entity that
* makes use of optimistic locking fails.
*
* @throws Exception
*/
public function flush($entity = null)
{
if (!is_null($entity))
throw new Exception('You shall not use single entity flush!');

$this->errorIfClosed();

$this->unitOfWork->commit($entity);
Expand Down

0 comments on commit dfbadfd

Please sign in to comment.