1 | <?php |
||
22 | abstract class Processor implements ProcessorInterface |
||
23 | { |
||
24 | /** |
||
25 | * @var string[]|BuilderInterface[] |
||
26 | */ |
||
27 | protected const CRITERIA_MAPPINGS = []; |
||
28 | |||
29 | /** |
||
30 | * @var ObjectRepository|EntityRepository |
||
31 | */ |
||
32 | protected $repository; |
||
33 | |||
34 | /** |
||
35 | * @var EntityManagerInterface |
||
36 | */ |
||
37 | protected $em; |
||
38 | |||
39 | /** |
||
40 | * @var ClassMetadata |
||
41 | */ |
||
42 | protected $meta; |
||
43 | |||
44 | /** |
||
45 | * DatabaseProcessor constructor. |
||
46 | * @param ObjectRepository $repository |
||
47 | * @param EntityManagerInterface $em |
||
48 | */ |
||
49 | 30 | public function __construct(ObjectRepository $repository, EntityManagerInterface $em) |
|
57 | |||
58 | /** |
||
59 | * @return EntityManagerInterface |
||
60 | */ |
||
61 | public function getEntityManager(): EntityManagerInterface |
||
65 | |||
66 | /** |
||
67 | * @return EntityRepository|ObjectRepository |
||
68 | */ |
||
69 | public function getRepository(): ObjectRepository |
||
73 | |||
74 | /** |
||
75 | * @return ClassMetadata |
||
76 | */ |
||
77 | 2 | public function getMetadata(): ClassMetadata |
|
81 | |||
82 | /** |
||
83 | * @param mixed $context |
||
84 | * @param Query $query |
||
85 | * @return \Generator |
||
86 | */ |
||
87 | 30 | protected function bypass($context, Query $query): \Generator |
|
97 | |||
98 | /** |
||
99 | * @param \Generator $generator |
||
100 | * @return array |
||
101 | */ |
||
102 | 30 | protected function await(\Generator $generator): array |
|
118 | |||
119 | /** |
||
120 | * @param Query $query |
||
121 | * @return \Generator|BuilderInterface[] |
||
122 | */ |
||
123 | 30 | private function builders(Query $query): \Generator |
|
135 | |||
136 | /** |
||
137 | * @param Query $query |
||
138 | * @param CriterionInterface $criterion |
||
139 | * @return BuilderInterface |
||
140 | */ |
||
141 | 30 | protected function getBuilder(Query $query, CriterionInterface $criterion): BuilderInterface |
|
156 | |||
157 | /** |
||
158 | * @param string $entity |
||
159 | * @return ProcessorInterface |
||
160 | */ |
||
161 | 2 | public function getProcessor(string $entity): ProcessorInterface |
|
171 | } |
||
172 |