1 | <?php |
---|
2 | /* |
---|
3 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
---|
4 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
---|
5 | * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
---|
6 | * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT |
---|
7 | * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
---|
8 | * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
---|
9 | * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
---|
10 | * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
---|
11 | * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
---|
12 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
---|
13 | * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
---|
14 | * |
---|
15 | * This software consists of voluntary contributions made by many individuals |
---|
16 | * and is licensed under the LGPL. For more information, see |
---|
17 | * <http://www.doctrine-project.org>. |
---|
18 | */ |
---|
19 | |
---|
20 | namespace Doctrine\ORM\Mapping\Driver; |
---|
21 | |
---|
22 | use Doctrine\ORM\Mapping\ClassMetadataInfo, |
---|
23 | Doctrine\ORM\Mapping\MappingException; |
---|
24 | |
---|
25 | /** |
---|
26 | * The YamlDriver reads the mapping metadata from yaml schema files. |
---|
27 | * |
---|
28 | * @since 2.0 |
---|
29 | * @author Benjamin Eberlei <kontakt@beberlei.de> |
---|
30 | * @author Guilherme Blanco <guilhermeblanco@hotmail.com> |
---|
31 | * @author Jonathan H. Wage <jonwage@gmail.com> |
---|
32 | * @author Roman Borschel <roman@code-factory.org> |
---|
33 | */ |
---|
34 | class YamlDriver extends AbstractFileDriver |
---|
35 | { |
---|
36 | /** |
---|
37 | * {@inheritdoc} |
---|
38 | */ |
---|
39 | protected $_fileExtension = '.dcm.yml'; |
---|
40 | |
---|
41 | /** |
---|
42 | * {@inheritdoc} |
---|
43 | */ |
---|
44 | public function loadMetadataForClass($className, ClassMetadataInfo $metadata) |
---|
45 | { |
---|
46 | $element = $this->getElement($className); |
---|
47 | |
---|
48 | if ($element['type'] == 'entity') { |
---|
49 | if (isset($element['repositoryClass'])) { |
---|
50 | $metadata->setCustomRepositoryClass($element['repositoryClass']); |
---|
51 | } |
---|
52 | if (isset($element['readOnly']) && $element['readOnly'] == true) { |
---|
53 | $metadata->markReadOnly(); |
---|
54 | } |
---|
55 | } else if ($element['type'] == 'mappedSuperclass') { |
---|
56 | $metadata->setCustomRepositoryClass( |
---|
57 | isset($element['repositoryClass']) ? $element['repositoryClass'] : null |
---|
58 | ); |
---|
59 | $metadata->isMappedSuperclass = true; |
---|
60 | } else { |
---|
61 | throw MappingException::classIsNotAValidEntityOrMappedSuperClass($className); |
---|
62 | } |
---|
63 | |
---|
64 | // Evaluate root level properties |
---|
65 | $table = array(); |
---|
66 | if (isset($element['table'])) { |
---|
67 | $table['name'] = $element['table']; |
---|
68 | } |
---|
69 | $metadata->setPrimaryTable($table); |
---|
70 | |
---|
71 | // Evaluate named queries |
---|
72 | if (isset($element['namedQueries'])) { |
---|
73 | foreach ($element['namedQueries'] as $name => $queryMapping) { |
---|
74 | if (is_string($queryMapping)) { |
---|
75 | $queryMapping = array('query' => $queryMapping); |
---|
76 | } |
---|
77 | |
---|
78 | if ( ! isset($queryMapping['name'])) { |
---|
79 | $queryMapping['name'] = $name; |
---|
80 | } |
---|
81 | |
---|
82 | $metadata->addNamedQuery($queryMapping); |
---|
83 | } |
---|
84 | } |
---|
85 | |
---|
86 | /* not implemented specially anyway. use table = schema.table |
---|
87 | if (isset($element['schema'])) { |
---|
88 | $metadata->table['schema'] = $element['schema']; |
---|
89 | }*/ |
---|
90 | |
---|
91 | if (isset($element['inheritanceType'])) { |
---|
92 | $metadata->setInheritanceType(constant('Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_' . strtoupper($element['inheritanceType']))); |
---|
93 | |
---|
94 | if ($metadata->inheritanceType != \Doctrine\ORM\Mapping\ClassMetadata::INHERITANCE_TYPE_NONE) { |
---|
95 | // Evaluate discriminatorColumn |
---|
96 | if (isset($element['discriminatorColumn'])) { |
---|
97 | $discrColumn = $element['discriminatorColumn']; |
---|
98 | $metadata->setDiscriminatorColumn(array( |
---|
99 | 'name' => $discrColumn['name'], |
---|
100 | 'type' => $discrColumn['type'], |
---|
101 | 'length' => $discrColumn['length'] |
---|
102 | )); |
---|
103 | } else { |
---|
104 | $metadata->setDiscriminatorColumn(array('name' => 'dtype', 'type' => 'string', 'length' => 255)); |
---|
105 | } |
---|
106 | |
---|
107 | // Evaluate discriminatorMap |
---|
108 | if (isset($element['discriminatorMap'])) { |
---|
109 | $metadata->setDiscriminatorMap($element['discriminatorMap']); |
---|
110 | } |
---|
111 | } |
---|
112 | } |
---|
113 | |
---|
114 | |
---|
115 | // Evaluate changeTrackingPolicy |
---|
116 | if (isset($element['changeTrackingPolicy'])) { |
---|
117 | $metadata->setChangeTrackingPolicy(constant('Doctrine\ORM\Mapping\ClassMetadata::CHANGETRACKING_' |
---|
118 | . strtoupper($element['changeTrackingPolicy']))); |
---|
119 | } |
---|
120 | |
---|
121 | // Evaluate indexes |
---|
122 | if (isset($element['indexes'])) { |
---|
123 | foreach ($element['indexes'] as $name => $index) { |
---|
124 | if ( ! isset($index['name'])) { |
---|
125 | $index['name'] = $name; |
---|
126 | } |
---|
127 | |
---|
128 | if (is_string($index['columns'])) { |
---|
129 | $columns = explode(',', $index['columns']); |
---|
130 | } else { |
---|
131 | $columns = $index['columns']; |
---|
132 | } |
---|
133 | |
---|
134 | $metadata->table['indexes'][$index['name']] = array( |
---|
135 | 'columns' => $columns |
---|
136 | ); |
---|
137 | } |
---|
138 | } |
---|
139 | |
---|
140 | // Evaluate uniqueConstraints |
---|
141 | if (isset($element['uniqueConstraints'])) { |
---|
142 | foreach ($element['uniqueConstraints'] as $name => $unique) { |
---|
143 | if ( ! isset($unique['name'])) { |
---|
144 | $unique['name'] = $name; |
---|
145 | } |
---|
146 | |
---|
147 | if (is_string($unique['columns'])) { |
---|
148 | $columns = explode(',', $unique['columns']); |
---|
149 | } else { |
---|
150 | $columns = $unique['columns']; |
---|
151 | } |
---|
152 | |
---|
153 | $metadata->table['uniqueConstraints'][$unique['name']] = array( |
---|
154 | 'columns' => $columns |
---|
155 | ); |
---|
156 | } |
---|
157 | } |
---|
158 | |
---|
159 | $associationIds = array(); |
---|
160 | if (isset($element['id'])) { |
---|
161 | // Evaluate identifier settings |
---|
162 | foreach ($element['id'] as $name => $idElement) { |
---|
163 | if (isset($idElement['associationKey']) && $idElement['associationKey'] == true) { |
---|
164 | $associationIds[$name] = true; |
---|
165 | continue; |
---|
166 | } |
---|
167 | |
---|
168 | $mapping = array( |
---|
169 | 'id' => true, |
---|
170 | 'fieldName' => $name |
---|
171 | ); |
---|
172 | |
---|
173 | if (isset($idElement['type'])) { |
---|
174 | $mapping['type'] = $idElement['type']; |
---|
175 | } |
---|
176 | |
---|
177 | if (isset($idElement['column'])) { |
---|
178 | $mapping['columnName'] = $idElement['column']; |
---|
179 | } |
---|
180 | |
---|
181 | if (isset($idElement['length'])) { |
---|
182 | $mapping['length'] = $idElement['length']; |
---|
183 | } |
---|
184 | |
---|
185 | if (isset($idElement['columnDefinition'])) { |
---|
186 | $mapping['columnDefinition'] = $idElement['columnDefinition']; |
---|
187 | } |
---|
188 | |
---|
189 | $metadata->mapField($mapping); |
---|
190 | |
---|
191 | if (isset($idElement['generator'])) { |
---|
192 | $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' |
---|
193 | . strtoupper($idElement['generator']['strategy']))); |
---|
194 | } |
---|
195 | // Check for SequenceGenerator/TableGenerator definition |
---|
196 | if (isset($idElement['sequenceGenerator'])) { |
---|
197 | $metadata->setSequenceGeneratorDefinition($idElement['sequenceGenerator']); |
---|
198 | } else if (isset($idElement['tableGenerator'])) { |
---|
199 | throw MappingException::tableIdGeneratorNotImplemented($className); |
---|
200 | } |
---|
201 | } |
---|
202 | } |
---|
203 | |
---|
204 | // Evaluate fields |
---|
205 | if (isset($element['fields'])) { |
---|
206 | foreach ($element['fields'] as $name => $fieldMapping) { |
---|
207 | |
---|
208 | $mapping = array( |
---|
209 | 'fieldName' => $name |
---|
210 | ); |
---|
211 | |
---|
212 | if (isset($fieldMapping['type'])) { |
---|
213 | $e = explode('(', $fieldMapping['type']); |
---|
214 | $fieldMapping['type'] = $e[0]; |
---|
215 | $mapping['type'] = $fieldMapping['type']; |
---|
216 | |
---|
217 | if (isset($e[1])) { |
---|
218 | $fieldMapping['length'] = substr($e[1], 0, strlen($e[1]) - 1); |
---|
219 | } |
---|
220 | } |
---|
221 | |
---|
222 | if (isset($fieldMapping['id'])) { |
---|
223 | $mapping['id'] = true; |
---|
224 | if (isset($fieldMapping['generator']['strategy'])) { |
---|
225 | $metadata->setIdGeneratorType(constant('Doctrine\ORM\Mapping\ClassMetadata::GENERATOR_TYPE_' |
---|
226 | . strtoupper($fieldMapping['generator']['strategy']))); |
---|
227 | } |
---|
228 | } |
---|
229 | if (isset($fieldMapping['column'])) { |
---|
230 | $mapping['columnName'] = $fieldMapping['column']; |
---|
231 | } |
---|
232 | if (isset($fieldMapping['length'])) { |
---|
233 | $mapping['length'] = $fieldMapping['length']; |
---|
234 | } |
---|
235 | if (isset($fieldMapping['precision'])) { |
---|
236 | $mapping['precision'] = $fieldMapping['precision']; |
---|
237 | } |
---|
238 | if (isset($fieldMapping['scale'])) { |
---|
239 | $mapping['scale'] = $fieldMapping['scale']; |
---|
240 | } |
---|
241 | if (isset($fieldMapping['unique'])) { |
---|
242 | $mapping['unique'] = (bool)$fieldMapping['unique']; |
---|
243 | } |
---|
244 | if (isset($fieldMapping['options'])) { |
---|
245 | $mapping['options'] = $fieldMapping['options']; |
---|
246 | } |
---|
247 | if (isset($fieldMapping['nullable'])) { |
---|
248 | $mapping['nullable'] = $fieldMapping['nullable']; |
---|
249 | } |
---|
250 | if (isset($fieldMapping['version']) && $fieldMapping['version']) { |
---|
251 | $metadata->setVersionMapping($mapping); |
---|
252 | } |
---|
253 | if (isset($fieldMapping['columnDefinition'])) { |
---|
254 | $mapping['columnDefinition'] = $fieldMapping['columnDefinition']; |
---|
255 | } |
---|
256 | |
---|
257 | $metadata->mapField($mapping); |
---|
258 | } |
---|
259 | } |
---|
260 | |
---|
261 | // Evaluate oneToOne relationships |
---|
262 | if (isset($element['oneToOne'])) { |
---|
263 | foreach ($element['oneToOne'] as $name => $oneToOneElement) { |
---|
264 | $mapping = array( |
---|
265 | 'fieldName' => $name, |
---|
266 | 'targetEntity' => $oneToOneElement['targetEntity'] |
---|
267 | ); |
---|
268 | |
---|
269 | if (isset($associationIds[$mapping['fieldName']])) { |
---|
270 | $mapping['id'] = true; |
---|
271 | } |
---|
272 | |
---|
273 | if (isset($oneToOneElement['fetch'])) { |
---|
274 | $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToOneElement['fetch']); |
---|
275 | } |
---|
276 | |
---|
277 | if (isset($oneToOneElement['mappedBy'])) { |
---|
278 | $mapping['mappedBy'] = $oneToOneElement['mappedBy']; |
---|
279 | } else { |
---|
280 | if (isset($oneToOneElement['inversedBy'])) { |
---|
281 | $mapping['inversedBy'] = $oneToOneElement['inversedBy']; |
---|
282 | } |
---|
283 | |
---|
284 | $joinColumns = array(); |
---|
285 | |
---|
286 | if (isset($oneToOneElement['joinColumn'])) { |
---|
287 | $joinColumns[] = $this->_getJoinColumnMapping($oneToOneElement['joinColumn']); |
---|
288 | } else if (isset($oneToOneElement['joinColumns'])) { |
---|
289 | foreach ($oneToOneElement['joinColumns'] as $name => $joinColumnElement) { |
---|
290 | if (!isset($joinColumnElement['name'])) { |
---|
291 | $joinColumnElement['name'] = $name; |
---|
292 | } |
---|
293 | |
---|
294 | $joinColumns[] = $this->_getJoinColumnMapping($joinColumnElement); |
---|
295 | } |
---|
296 | } |
---|
297 | |
---|
298 | $mapping['joinColumns'] = $joinColumns; |
---|
299 | } |
---|
300 | |
---|
301 | if (isset($oneToOneElement['cascade'])) { |
---|
302 | $mapping['cascade'] = $oneToOneElement['cascade']; |
---|
303 | } |
---|
304 | |
---|
305 | if (isset($oneToOneElement['orphanRemoval'])) { |
---|
306 | $mapping['orphanRemoval'] = (bool)$oneToOneElement['orphanRemoval']; |
---|
307 | } |
---|
308 | |
---|
309 | $metadata->mapOneToOne($mapping); |
---|
310 | } |
---|
311 | } |
---|
312 | |
---|
313 | // Evaluate oneToMany relationships |
---|
314 | if (isset($element['oneToMany'])) { |
---|
315 | foreach ($element['oneToMany'] as $name => $oneToManyElement) { |
---|
316 | $mapping = array( |
---|
317 | 'fieldName' => $name, |
---|
318 | 'targetEntity' => $oneToManyElement['targetEntity'], |
---|
319 | 'mappedBy' => $oneToManyElement['mappedBy'] |
---|
320 | ); |
---|
321 | |
---|
322 | if (isset($oneToManyElement['fetch'])) { |
---|
323 | $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $oneToManyElement['fetch']); |
---|
324 | } |
---|
325 | |
---|
326 | if (isset($oneToManyElement['cascade'])) { |
---|
327 | $mapping['cascade'] = $oneToManyElement['cascade']; |
---|
328 | } |
---|
329 | |
---|
330 | if (isset($oneToManyElement['orphanRemoval'])) { |
---|
331 | $mapping['orphanRemoval'] = (bool)$oneToManyElement['orphanRemoval']; |
---|
332 | } |
---|
333 | |
---|
334 | if (isset($oneToManyElement['orderBy'])) { |
---|
335 | $mapping['orderBy'] = $oneToManyElement['orderBy']; |
---|
336 | } |
---|
337 | |
---|
338 | if (isset($oneToManyElement['indexBy'])) { |
---|
339 | $mapping['indexBy'] = $oneToManyElement['indexBy']; |
---|
340 | } |
---|
341 | |
---|
342 | $metadata->mapOneToMany($mapping); |
---|
343 | } |
---|
344 | } |
---|
345 | |
---|
346 | // Evaluate manyToOne relationships |
---|
347 | if (isset($element['manyToOne'])) { |
---|
348 | foreach ($element['manyToOne'] as $name => $manyToOneElement) { |
---|
349 | $mapping = array( |
---|
350 | 'fieldName' => $name, |
---|
351 | 'targetEntity' => $manyToOneElement['targetEntity'] |
---|
352 | ); |
---|
353 | |
---|
354 | if (isset($associationIds[$mapping['fieldName']])) { |
---|
355 | $mapping['id'] = true; |
---|
356 | } |
---|
357 | |
---|
358 | if (isset($manyToOneElement['fetch'])) { |
---|
359 | $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToOneElement['fetch']); |
---|
360 | } |
---|
361 | |
---|
362 | if (isset($manyToOneElement['inversedBy'])) { |
---|
363 | $mapping['inversedBy'] = $manyToOneElement['inversedBy']; |
---|
364 | } |
---|
365 | |
---|
366 | $joinColumns = array(); |
---|
367 | |
---|
368 | if (isset($manyToOneElement['joinColumn'])) { |
---|
369 | $joinColumns[] = $this->_getJoinColumnMapping($manyToOneElement['joinColumn']); |
---|
370 | } else if (isset($manyToOneElement['joinColumns'])) { |
---|
371 | foreach ($manyToOneElement['joinColumns'] as $name => $joinColumnElement) { |
---|
372 | if (!isset($joinColumnElement['name'])) { |
---|
373 | $joinColumnElement['name'] = $name; |
---|
374 | } |
---|
375 | |
---|
376 | $joinColumns[] = $this->_getJoinColumnMapping($joinColumnElement); |
---|
377 | } |
---|
378 | } |
---|
379 | |
---|
380 | $mapping['joinColumns'] = $joinColumns; |
---|
381 | |
---|
382 | if (isset($manyToOneElement['cascade'])) { |
---|
383 | $mapping['cascade'] = $manyToOneElement['cascade']; |
---|
384 | } |
---|
385 | |
---|
386 | $metadata->mapManyToOne($mapping); |
---|
387 | } |
---|
388 | } |
---|
389 | |
---|
390 | // Evaluate manyToMany relationships |
---|
391 | if (isset($element['manyToMany'])) { |
---|
392 | foreach ($element['manyToMany'] as $name => $manyToManyElement) { |
---|
393 | $mapping = array( |
---|
394 | 'fieldName' => $name, |
---|
395 | 'targetEntity' => $manyToManyElement['targetEntity'] |
---|
396 | ); |
---|
397 | |
---|
398 | if (isset($manyToManyElement['fetch'])) { |
---|
399 | $mapping['fetch'] = constant('Doctrine\ORM\Mapping\ClassMetadata::FETCH_' . $manyToManyElement['fetch']); |
---|
400 | } |
---|
401 | |
---|
402 | if (isset($manyToManyElement['mappedBy'])) { |
---|
403 | $mapping['mappedBy'] = $manyToManyElement['mappedBy']; |
---|
404 | } else if (isset($manyToManyElement['joinTable'])) { |
---|
405 | |
---|
406 | $joinTableElement = $manyToManyElement['joinTable']; |
---|
407 | $joinTable = array( |
---|
408 | 'name' => $joinTableElement['name'] |
---|
409 | ); |
---|
410 | |
---|
411 | if (isset($joinTableElement['schema'])) { |
---|
412 | $joinTable['schema'] = $joinTableElement['schema']; |
---|
413 | } |
---|
414 | |
---|
415 | foreach ($joinTableElement['joinColumns'] as $name => $joinColumnElement) { |
---|
416 | if (!isset($joinColumnElement['name'])) { |
---|
417 | $joinColumnElement['name'] = $name; |
---|
418 | } |
---|
419 | |
---|
420 | $joinTable['joinColumns'][] = $this->_getJoinColumnMapping($joinColumnElement); |
---|
421 | } |
---|
422 | |
---|
423 | foreach ($joinTableElement['inverseJoinColumns'] as $name => $joinColumnElement) { |
---|
424 | if (!isset($joinColumnElement['name'])) { |
---|
425 | $joinColumnElement['name'] = $name; |
---|
426 | } |
---|
427 | |
---|
428 | $joinTable['inverseJoinColumns'][] = $this->_getJoinColumnMapping($joinColumnElement); |
---|
429 | } |
---|
430 | |
---|
431 | $mapping['joinTable'] = $joinTable; |
---|
432 | } |
---|
433 | |
---|
434 | if (isset($manyToManyElement['inversedBy'])) { |
---|
435 | $mapping['inversedBy'] = $manyToManyElement['inversedBy']; |
---|
436 | } |
---|
437 | |
---|
438 | if (isset($manyToManyElement['cascade'])) { |
---|
439 | $mapping['cascade'] = $manyToManyElement['cascade']; |
---|
440 | } |
---|
441 | |
---|
442 | if (isset($manyToManyElement['orderBy'])) { |
---|
443 | $mapping['orderBy'] = $manyToManyElement['orderBy']; |
---|
444 | } |
---|
445 | |
---|
446 | if (isset($manyToManyElement['indexBy'])) { |
---|
447 | $mapping['indexBy'] = $manyToManyElement['indexBy']; |
---|
448 | } |
---|
449 | |
---|
450 | if (isset($manyToManyElement['orphanRemoval'])) { |
---|
451 | $mapping['orphanRemoval'] = (bool)$manyToManyElement['orphanRemoval']; |
---|
452 | } |
---|
453 | |
---|
454 | $metadata->mapManyToMany($mapping); |
---|
455 | } |
---|
456 | } |
---|
457 | |
---|
458 | // Evaluate lifeCycleCallbacks |
---|
459 | if (isset($element['lifecycleCallbacks'])) { |
---|
460 | foreach ($element['lifecycleCallbacks'] as $type => $methods) { |
---|
461 | foreach ($methods as $method) { |
---|
462 | $metadata->addLifecycleCallback($method, constant('Doctrine\ORM\Events::' . $type)); |
---|
463 | } |
---|
464 | } |
---|
465 | } |
---|
466 | } |
---|
467 | |
---|
468 | /** |
---|
469 | * Constructs a joinColumn mapping array based on the information |
---|
470 | * found in the given join column element. |
---|
471 | * |
---|
472 | * @param $joinColumnElement The array join column element |
---|
473 | * @return array The mapping array. |
---|
474 | */ |
---|
475 | private function _getJoinColumnMapping($joinColumnElement) |
---|
476 | { |
---|
477 | $joinColumn = array( |
---|
478 | 'name' => $joinColumnElement['name'], |
---|
479 | 'referencedColumnName' => $joinColumnElement['referencedColumnName'] |
---|
480 | ); |
---|
481 | |
---|
482 | if (isset($joinColumnElement['fieldName'])) { |
---|
483 | $joinColumn['fieldName'] = (string) $joinColumnElement['fieldName']; |
---|
484 | } |
---|
485 | |
---|
486 | if (isset($joinColumnElement['unique'])) { |
---|
487 | $joinColumn['unique'] = (bool) $joinColumnElement['unique']; |
---|
488 | } |
---|
489 | |
---|
490 | if (isset($joinColumnElement['nullable'])) { |
---|
491 | $joinColumn['nullable'] = (bool) $joinColumnElement['nullable']; |
---|
492 | } |
---|
493 | |
---|
494 | if (isset($joinColumnElement['onDelete'])) { |
---|
495 | $joinColumn['onDelete'] = $joinColumnElement['onDelete']; |
---|
496 | } |
---|
497 | |
---|
498 | if (isset($joinColumnElement['columnDefinition'])) { |
---|
499 | $joinColumn['columnDefinition'] = $joinColumnElement['columnDefinition']; |
---|
500 | } |
---|
501 | |
---|
502 | return $joinColumn; |
---|
503 | } |
---|
504 | |
---|
505 | /** |
---|
506 | * {@inheritdoc} |
---|
507 | */ |
---|
508 | protected function _loadMappingFile($file) |
---|
509 | { |
---|
510 | return \Symfony\Component\Yaml\Yaml::parse($file); |
---|
511 | } |
---|
512 | } |
---|