Small optimization.
This commit is contained in:
parent
678f47f494
commit
bc268da8c2
@ -383,10 +383,9 @@ class ManyToManyPersister extends AbstractCollectionPersister
|
|||||||
*/
|
*/
|
||||||
protected function getDeleteRowSQL(PersistentCollection $coll)
|
protected function getDeleteRowSQL(PersistentCollection $coll)
|
||||||
{
|
{
|
||||||
$columns = array();
|
|
||||||
$mapping = $coll->getMapping();
|
$mapping = $coll->getMapping();
|
||||||
$class = $this->em->getClassMetadata(get_class($coll->getOwner()));
|
$class = $this->em->getClassMetadata($mapping['sourceEntity']);
|
||||||
$tableName = $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform);
|
$columns = array();
|
||||||
|
|
||||||
foreach ($mapping['joinTable']['joinColumns'] as $joinColumn) {
|
foreach ($mapping['joinTable']['joinColumns'] as $joinColumn) {
|
||||||
$columns[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
|
$columns[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
|
||||||
@ -396,7 +395,7 @@ class ManyToManyPersister extends AbstractCollectionPersister
|
|||||||
$columns[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
|
$columns[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 'DELETE FROM ' . $tableName
|
return 'DELETE FROM ' . $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform)
|
||||||
. ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
|
. ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user