| Total Complexity | 11 |
| Total Lines | 55 |
| Duplicated Lines | 0 % |
| Coverage | 100% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | class DoctrinePersister implements PersisterInterface |
||
| 17 | { |
||
| 18 | private $em; |
||
| 19 | private $batch = 0; |
||
| 20 | |||
| 21 | private $whiteList = []; |
||
| 22 | private $blackList = []; |
||
| 23 | |||
| 24 | 5 | public function __construct(EntityManagerInterface $em) |
|
| 25 | { |
||
| 26 | 5 | $this->em = $em; |
|
| 27 | 5 | } |
|
| 28 | |||
| 29 | 5 | public function persist($entity, $batchCount = 20, $whiteList = [], $blackList = []) |
|
| 43 | } |
||
| 44 | 3 | ||
| 45 | 2 | public function finalize() |
|
| 48 | } |
||
| 49 | 4 | ||
| 50 | 4 | private function writeBatch() |
|
| 51 | { |
||
| 52 | 3 | $this->em->flush(); |
|
| 53 | 3 | $this->clear(); |
|
| 54 | |||
| 55 | 4 | $this->batch = 0; |
|
| 56 | } |
||
| 57 | 4 | ||
| 58 | 2 | private function clear() |
|
| 71 | } |
||
| 72 | } |
||
| 73 |