From 68bb0c1ae152f85f2457e4d53908aeba61b045f7 Mon Sep 17 00:00:00 2001 From: Guilherme Blanco Date: Mon, 21 Feb 2011 00:37:32 -0300 Subject: [PATCH] [DDC-1035] Fixed orphanRemoval on YAML mapping driver. --- lib/Doctrine/ORM/Mapping/Driver/YamlDriver.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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']; }