| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 29 | public function onFlush(OnFlushEventArgs $args): void |
||
| 30 | { |
||
| 31 | $entityManager = $args->getObjectManager(); |
||
| 32 | $transaction = new Transaction($entityManager); |
||
| 33 | |||
| 34 | // Populate transaction |
||
| 35 | $this->transactionManager->populate($transaction); |
||
| 36 | |||
| 37 | $driver = $entityManager->getConnection()->getDriver(); |
||
|
|
|||
| 38 | if ($driver instanceof DHDriver) { |
||
| 39 | $driver->addDHFlusher(function () use ($transaction): void { |
||
| 40 | $this->transactionManager->process($transaction); |
||
| 41 | $transaction->reset(); |
||
| 42 | }); |
||
| 51 |