Total Complexity | 11 |
Total Lines | 52 |
Duplicated Lines | 0 % |
Coverage | 100% |
Changes | 0 |
1 | <?php |
||
12 | class DoctrinePersister implements PersisterInterface |
||
13 | { |
||
14 | private $em; |
||
15 | private $batch = 0; |
||
16 | |||
17 | private $whiteList = []; |
||
18 | private $blackList = []; |
||
19 | |||
20 | 5 | public function __construct(EntityManagerInterface $em) |
|
21 | { |
||
22 | 5 | $this->em = $em; |
|
23 | 5 | } |
|
24 | |||
25 | 5 | public function persist($entity, $batchCount = 20, $whiteList = [], $blackList = []) |
|
35 | } |
||
36 | 5 | } |
|
37 | |||
38 | 3 | public function finalize() |
|
41 | 2 | } |
|
42 | |||
43 | 4 | private function writeBatch() |
|
44 | { |
||
45 | 4 | $this->em->flush(); |
|
46 | 4 | $this->clear(); |
|
47 | |||
48 | 3 | $this->batch = 0; |
|
49 | 3 | } |
|
50 | |||
51 | 4 | private function clear() |
|
64 | 3 | } |
|
65 | } |
||
66 |