diff --git a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php index 0f88474f1..0a66a156e 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php @@ -276,6 +276,10 @@ class YamlDriver extends AbstractFileDriver $mapping['cascade'] = $oneToOneElement['cascade']; } + if (isset($oneToOneElement['orphanRemoval'])) { + $mapping['orphanRemoval'] = (bool)$oneToOneElement['orphanRemoval']; + } + $metadata->mapOneToOne($mapping); } } @@ -297,6 +301,10 @@ class YamlDriver extends AbstractFileDriver $mapping['cascade'] = $oneToManyElement['cascade']; } + if (isset($oneToManyElement['orphanRemoval'])) { + $mapping['orphanRemoval'] = (bool)$oneToManyElement['orphanRemoval']; + } + if (isset($oneToManyElement['orderBy'])) { $mapping['orderBy'] = $oneToManyElement['orderBy']; } @@ -349,6 +357,10 @@ class YamlDriver extends AbstractFileDriver $mapping['cascade'] = $manyToOneElement['cascade']; } + if (isset($manyToOneElement['orphanRemoval'])) { + $mapping['orphanRemoval'] = (bool)$manyToOneElement['orphanRemoval']; + } + $metadata->mapManyToOne($mapping); } } @@ -404,6 +416,10 @@ class YamlDriver extends AbstractFileDriver $mapping['cascade'] = $manyToManyElement['cascade']; } + if (isset($manyToManyElement['orphanRemoval'])) { + $mapping['orphanRemoval'] = (bool)$manyToManyElement['orphan-removal']; + } + if (isset($manyToManyElement['orderBy'])) { $mapping['orderBy'] = $manyToManyElement['orderBy']; }