1
0
mirror of https://github.com/fzaninotto/Faker.git synced 2025-03-22 08:19:52 +01:00

Update src/Faker/ORM/Doctrine/Populator.php

Moved $entityManager->flush() to be called at the end of each loop that creates entities of specific class to allow for the population of entity data that has associations to other entities which are being created earlier in the execution.
This commit is contained in:
afishnamedsquish 2012-11-12 14:03:53 -05:00
parent 4508f34a79
commit ae8bdc8197

View File

@ -62,8 +62,8 @@ class Populator
for ($i=0; $i < $number; $i++) {
$insertedEntities[$class][]= $this->entities[$class]->execute($entityManager, $insertedEntities);
}
$entityManager->flush();
}
$entityManager->flush();
return $insertedEntities;
}