8000 #1169 DDC-3343 - corrected persister logic - only uses the entity per… · symfonyaml/orm@f5705d6 · GitHub
[go: up one dir, main page]

Skip to content

Commit f5705d6

Browse files
committed
doctrine#1169 DDC-3343 - corrected persister logic - only uses the entity persister to perform deletes on the owning side
1 parent a1bd3e8 commit f5705d6

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/Doctrine/ORM/Persisters/OneToManyPersister.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -244,10 +244,11 @@ public function removeElement(PersistentCollection $coll, $element)
244244
return false;
245245
}
246246

247-
$class = $this->em->getClassMetadata($mapping['targetEntity']);
248-
$sql = 'DELETE FROM ' . $this->quoteStrategy->getTableName($class, $this->platform)
249-
. ' WHERE ' . implode('= ? AND ', $class->getIdentifierColumnNames()) . ' = ?';
247+
$this
248+
->uow
249+
->getEntityPersister($mapping['targetEntity'])
250+
->delete($element);
250251

251-
return (bool) $this->conn->executeUpdate($sql, $this->getDeleteRowSQLParameters($coll, $element));
252+
return true;
252253
}
253254
}

0 commit comments

Comments
 (0)
0