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|null |
||
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 | public function addDiscriminatorColumn(string $class, array $columnDef): void |
||
102 | |||
103 | public function addInheritanceType(string $class, string $type): void |
||
109 | |||
110 | public function addAssociation(string $class, string $type, array $options): void |
||
122 | |||
123 | public function addIndex(string $class, string $name, array $columns): void |
||
135 | |||
136 | public function addUnique(string $class, string $name, array $columns): void |
||
148 | |||
149 | /** |
||
150 | * Adds new override. |
||
151 | */ |
||
152 | final public function addOverride(string $class, string $type, array $options): void |
||
164 | |||
165 | public function getAssociations(): array |
||
169 | |||
170 | public function getDiscriminators(): array |
||
174 | |||
175 | public function getDiscriminatorColumns(): array |
||
179 | |||
180 | public function getInheritanceTypes(): array |
||
184 | |||
185 | public function getIndexes(): array |
||
189 | |||
190 | public function getUniques(): array |
||
194 | |||
195 | /** |
||
196 | * Get all overrides. |
||
197 | */ |
||
198 | final public function getOverrides(): array |
||
202 | |||
203 | public function clear(): void |
||
207 | |||
208 | private function initialize(): void |
||
218 | } |
||
219 |