$dal = Container::make('dal.manager');
foreach (['a', 'b'] as $n) {
foreach ([1, 2, 3, 4, 5] as $i) {
$recipe = new Recipe();
$recipe->setName($n . $i);
$dal->persist($recipe);
$dal->flush();
}
}
$repository = $dal->getRepository('Graze\Lib\Entity\Product\Recipe');
dump($repository->findAll());
This inserts only b4 and b5, if I move the flush to after the for each loop, i.e. just one flush, it inserts all records as expected.
This inserts only b4 and b5, if I move the flush to after the for each loop, i.e. just one flush, it inserts all records as expected.