graze / graze/dal

Multiple flushes do not behave as expected

Open
#28 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
PHP
Stars
8
Forks
0
PR merge metrics
No merged PRs in 30d

Description

```
$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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.