Skip to content

Commit

Permalink
Fix (bug fzaninotto#1862): Do not clear entity manager for doctrine o…
Browse files Browse the repository at this point in the history
…rm populator (fzaninotto#1995)

Bug: fzaninotto#1862
Clear specific entities is deprecated and will not be supported in Doctrine 3.0. (doctrine/orm@9ccb883)
Bug introduced: c49cd54
Related issue: https://stackoverflow.com/questions/18215975/doctrine-a-new-entity-was-found-through-the-relationship
  • Loading branch information
jlekowski authored and GrahamCampbell committed Oct 27, 2020
1 parent ebaf4f8 commit 4e92404
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/Faker/ORM/Doctrine/Populator.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,9 @@ public function execute($entityManager = null)
);
if (count($insertedEntities) % $this->batchSize === 0) {
$entityManager->flush();
$entityManager->clear($class);
}
}
$entityManager->flush();
$entityManager->clear($class);
}

return $insertedEntities;
Expand Down

0 comments on commit 4e92404

Please sign in to comment.