1 | <?php namespace Limoncello\Models; |
||
25 | class SchemaStorage implements SchemaStorageInterface |
||
26 | { |
||
27 | /** |
||
28 | * @var array |
||
29 | */ |
||
30 | private $relationshipTypes; |
||
31 | |||
32 | /** |
||
33 | * @var array |
||
34 | */ |
||
35 | private $reversedRelationships; |
||
36 | |||
37 | /** |
||
38 | * @var array |
||
39 | */ |
||
40 | private $foreignKeys; |
||
41 | |||
42 | /** |
||
43 | * @var array |
||
44 | */ |
||
45 | private $belongsToMany; |
||
46 | |||
47 | /** |
||
48 | * @var array |
||
49 | */ |
||
50 | private $tableNames; |
||
51 | |||
52 | /** |
||
53 | * @var array |
||
54 | */ |
||
55 | private $primaryKeys; |
||
56 | |||
57 | /** |
||
58 | * @var array |
||
59 | */ |
||
60 | private $attributeTypes; |
||
61 | |||
62 | /** |
||
63 | * @var array |
||
64 | */ |
||
65 | private $attributeLengths; |
||
66 | |||
67 | /** |
||
68 | * @var array |
||
69 | */ |
||
70 | private $attributes; |
||
71 | |||
72 | /** |
||
73 | * @inheritdoc |
||
74 | */ |
||
75 | 5 | public function getData() |
|
91 | |||
92 | /** |
||
93 | * @inheritdoc |
||
94 | */ |
||
95 | 5 | public function setData(array $data) |
|
101 | |||
102 | /** |
||
103 | * @inheritdoc |
||
104 | */ |
||
105 | 6 | public function registerClass($class, $tableName, $primaryKey, array $attributeTypes, array $attributeLengths) |
|
115 | |||
116 | /** |
||
117 | * @inheritdoc |
||
118 | */ |
||
119 | 1 | public function hasClass($class) |
|
125 | |||
126 | /** |
||
127 | * @inheritdoc |
||
128 | */ |
||
129 | 1 | public function getTable($class) |
|
135 | |||
136 | /** |
||
137 | * @inheritdoc |
||
138 | */ |
||
139 | 2 | public function getPrimaryKey($class) |
|
145 | |||
146 | /** |
||
147 | * @inheritdoc |
||
148 | */ |
||
149 | 1 | public function getAttributeTypes($class) |
|
155 | |||
156 | /** |
||
157 | * @inheritdoc |
||
158 | */ |
||
159 | 1 | public function getAttributeType($class, $name) |
|
165 | |||
166 | /** |
||
167 | * @inheritdoc |
||
168 | */ |
||
169 | 1 | public function hasAttributeType($class, $name) |
|
175 | |||
176 | /** |
||
177 | * @inheritdoc |
||
178 | */ |
||
179 | 1 | public function getAttributeLengths($class) |
|
185 | |||
186 | /** |
||
187 | * @inheritdoc |
||
188 | */ |
||
189 | 1 | public function hasAttributeLength($class, $name) |
|
195 | |||
196 | /** |
||
197 | * @inheritdoc |
||
198 | */ |
||
199 | 1 | public function getAttributeLength($class, $name) |
|
205 | |||
206 | /** |
||
207 | * @inheritdoc |
||
208 | */ |
||
209 | 1 | public function getAttributes($class) |
|
215 | |||
216 | /** |
||
217 | * @inheritdoc |
||
218 | */ |
||
219 | 2 | public function hasRelationship($class, $name) |
|
225 | |||
226 | /** |
||
227 | * @inheritdoc |
||
228 | */ |
||
229 | 2 | public function getRelationshipType($class, $name) |
|
235 | |||
236 | /** |
||
237 | * @inheritdoc |
||
238 | */ |
||
239 | 2 | public function getReverseRelationship($class, $name) |
|
245 | |||
246 | /** |
||
247 | * @inheritdoc |
||
248 | */ |
||
249 | 1 | public function getForeignKey($class, $name) |
|
255 | |||
256 | /** |
||
257 | * @inheritdoc |
||
258 | */ |
||
259 | 1 | public function getBelongsToManyRelationship($class, $name) |
|
265 | |||
266 | /** |
||
267 | * @inheritdoc |
||
268 | */ |
||
269 | 5 | public function registerBelongsToOneRelationship($class, $name, $foreignKey, $reverseClass, $reverseName) |
|
281 | |||
282 | /** |
||
283 | * @inheritdoc |
||
284 | */ |
||
285 | 5 | public function registerBelongsToManyRelationship( |
|
308 | |||
309 | /** |
||
310 | * @param int $type |
||
311 | * @param string $class |
||
312 | * @param string $name |
||
313 | */ |
||
314 | 5 | private function registerRelationshipType($type, $class, $name) |
|
323 | |||
324 | /** |
||
325 | * @param string $class |
||
326 | * @param string $name |
||
327 | * @param string $reverseClass |
||
328 | * @param string $reverseName |
||
329 | */ |
||
330 | 5 | private function registerReversedRelationship($class, $name, $reverseClass, $reverseName) |
|
338 | } |
||
339 |