From 2fa48c6e8860bd056c9ff48fae9ea33a48e632c6 Mon Sep 17 00:00:00 2001 From: Marco Pivetta Date: Thu, 5 Feb 2015 00:25:06 +0000 Subject: [PATCH] #1169 DDC-3343 - actually deleting associated elements when they are orphaned and EXTRA_LAZY is used --- lib/Doctrine/ORM/Persisters/OneToManyPersister.php | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/lib/Doctrine/ORM/Persisters/OneToManyPersister.php b/lib/Doctrine/ORM/Persisters/OneToManyPersister.php index 6e02272f4..539f13b14 100644 --- a/lib/Doctrine/ORM/Persisters/OneToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/OneToManyPersister.php @@ -249,16 +249,6 @@ class OneToManyPersister extends AbstractCollectionPersister $sql = 'DELETE FROM ' . $this->quoteStrategy->getTableName($class, $this->platform) . ' WHERE ' . implode('= ? AND ', $class->getIdentifierColumnNames()) . ' = ?'; - if ($element instanceof Proxy && ! $element->__isInitialized()) { - $element->__load(); - } - - // clearing owning side value - $targetMetadata->reflFields[$mapping['mappedBy']]->setValue($element, null); - - $this->uow->computeChangeSet($targetMetadata, $element); - $persister->update($element); - - return true; + return (bool) $this->conn->executeUpdate($sql, $this->getDeleteRowSQLParameters($coll, $element)); } }