1 | <?php |
||
16 | class DoctrineCollector |
||
17 | { |
||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | protected $associations; |
||
22 | |||
23 | /** |
||
24 | * @var array |
||
25 | */ |
||
26 | protected $indexes; |
||
27 | |||
28 | /** |
||
29 | * @var array |
||
30 | */ |
||
31 | protected $uniques; |
||
32 | |||
33 | /** |
||
34 | * @var array |
||
35 | */ |
||
36 | protected $discriminators; |
||
37 | |||
38 | /** |
||
39 | * @var array |
||
40 | */ |
||
41 | protected $discriminatorColumns; |
||
42 | |||
43 | /** |
||
44 | * @var array |
||
45 | */ |
||
46 | protected $inheritanceTypes; |
||
47 | |||
48 | /** |
||
49 | * @var array |
||
50 | */ |
||
51 | protected $overrides; |
||
52 | |||
53 | /** |
||
54 | * @var DoctrineCollector |
||
55 | */ |
||
56 | private static $instance; |
||
57 | |||
58 | public function __construct() |
||
62 | |||
63 | /** |
||
64 | * @return DoctrineCollector |
||
65 | */ |
||
66 | public static function getInstance(): self |
||
74 | |||
75 | /** |
||
76 | * Add a discriminator to a class. |
||
77 | * |
||
78 | * @param string $class The Class |
||
79 | * @param string $key Key is the database value and values are the classes |
||
80 | * @param string $discriminatorClass The mapped class |
||
81 | */ |
||
82 | public function addDiscriminator(string $class, string $key, string $discriminatorClass): void |
||
92 | |||
93 | /** |
||
94 | * Add the Discriminator Column. |
||
95 | * |
||
96 | * @param string $class |
||
97 | * @param array $columnDef |
||
98 | */ |
||
99 | public function addDiscriminatorColumn(string $class, array $columnDef): void |
||
105 | |||
106 | /** |
||
107 | * @param string $class |
||
108 | * @param string $type |
||
109 | */ |
||
110 | public function addInheritanceType(string $class, string $type): void |
||
116 | |||
117 | /** |
||
118 | * @param string $class |
||
119 | * @param string $type |
||
120 | * @param array $options |
||
121 | */ |
||
122 | public function addAssociation(string $class, string $type, array $options): void |
||
134 | |||
135 | /** |
||
136 | * @param string $class |
||
137 | * @param string $name |
||
138 | * @param array $columns |
||
139 | */ |
||
140 | public function addIndex(string $class, string $name, array $columns): void |
||
152 | |||
153 | /** |
||
154 | * @param string $class |
||
155 | * @param string $name |
||
156 | * @param array $columns |
||
157 | */ |
||
158 | public function addUnique(string $class, string $name, array $columns): void |
||
170 | |||
171 | /** |
||
172 | * Adds new override. |
||
173 | * |
||
174 | * @param string $class |
||
175 | * @param string $type |
||
176 | * @param array $options |
||
177 | */ |
||
178 | final public function addOverride(string $class, string $type, array $options): void |
||
190 | |||
191 | /** |
||
192 | * @return array |
||
193 | */ |
||
194 | public function getAssociations(): array |
||
198 | |||
199 | /** |
||
200 | * @return array |
||
201 | */ |
||
202 | public function getDiscriminators(): array |
||
206 | |||
207 | /** |
||
208 | * @return array |
||
209 | */ |
||
210 | public function getDiscriminatorColumns(): array |
||
214 | |||
215 | /** |
||
216 | * @return array |
||
217 | */ |
||
218 | public function getInheritanceTypes(): array |
||
222 | |||
223 | /** |
||
224 | * @return array |
||
225 | */ |
||
226 | public function getIndexes(): array |
||
230 | |||
231 | /** |
||
232 | * @return array |
||
233 | */ |
||
234 | public function getUniques(): array |
||
238 | |||
239 | /** |
||
240 | * Get all overrides. |
||
241 | * |
||
242 | * @return array |
||
243 | */ |
||
244 | final public function getOverrides(): array |
||
248 | |||
249 | public function clear() |
||
253 | |||
254 | private function initialize() |
||
264 | } |
||
265 |