From 51f29cddb9b0b4c041748df8c372bc1c906d9623 Mon Sep 17 00:00:00 2001 From: "Fabio B. Silva" Date: Mon, 11 Jun 2012 15:58:47 -0300 Subject: [PATCH] fix delete join table --- .../ORM/Persisters/BasicEntityPersister.php | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php index 8ca2c299b..da938d39f 100644 --- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php @@ -432,13 +432,20 @@ class BasicEntityPersister } if ($selfReferential) { - $otherKeys = array_keys($mapping['relationToSourceKeyColumns']); + foreach ($mapping['joinTable']['joinColumns'] as $joinColumn) { + $otherKeys[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $relatedClass); + } } } else { - $keys = array_keys($mapping['relationToSourceKeyColumns']); + + foreach ($mapping['joinTable']['joinColumns'] as $joinColumn) { + $keys[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->_class); + } if ($selfReferential) { - $otherKeys = array_keys($mapping['relationToTargetKeyColumns']); + foreach ($mapping['joinTable']['inverseJoinColumns'] as $joinColumn) { + $otherKeys[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $this->_class); + } } }