Skip to content

Commit

Permalink
#1246 DDC-3487 - removed unused assignment, minor alignment fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ocramius committed Jan 13, 2015
1 parent 97d1d53 commit 7f71cbc
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions lib/Doctrine/ORM/Persisters/ManyToManyPersister.php
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ protected function getDeleteSQL(PersistentCollection $coll)
}

return 'DELETE FROM ' . $joinTable
. ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
. ' WHERE ' . implode(' = ? AND ', $columns) . ' = ?';
}

/**
Expand Down Expand Up @@ -430,10 +430,9 @@ protected function getDeleteRowSQLParameters(PersistentCollection $coll, $elemen
*/
protected function getInsertRowSQL(PersistentCollection $coll)
{
$columns = array();
$mapping = $coll->getMapping();
$class = $this->em->getClassMetadata(get_class($coll->getOwner()));
$joinTable = $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform);
$columns = array();
$mapping = $coll->getMapping();
$class = $this->em->getClassMetadata(get_class($coll->getOwner()));

foreach ($mapping['joinTable']['joinColumns'] as $joinColumn) {
$columns[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
Expand All @@ -443,8 +442,10 @@ protected function getInsertRowSQL(PersistentCollection $coll)
$columns[] = $this->quoteStrategy->getJoinColumnName($joinColumn, $class, $this->platform);
}

return 'INSERT INTO ' . $joinTable . ' (' . implode(', ', $columns) . ')'
. ' VALUES (' . implode(', ', array_fill(0, count($columns), '?')) . ')';
return 'INSERT INTO ' . $this->quoteStrategy->getJoinTableName($mapping, $class, $this->platform)
. ' (' . implode(', ', $columns) . ')'
. ' VALUES'
. ' (' . implode(', ', array_fill(0, count($columns), '?')) . ')';
}

/**
Expand Down

0 comments on commit 7f71cbc

Please sign in to comment.