From dcd19bba225fba3843ea4bc7b41d02454a627d0c Mon Sep 17 00:00:00 2001 From: "Fabio B. Silva" <fabio.bat.silva@gmail.com> Date: Mon, 4 Jun 2012 12:58:51 -0300 Subject: [PATCH] use quote strategy in OneToManyPersister --- lib/Doctrine/ORM/Persisters/ManyToManyPersister.php | 2 +- lib/Doctrine/ORM/Persisters/OneToManyPersister.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php b/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php index f0e57ea20..dbbadadf0 100644 --- a/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/ManyToManyPersister.php @@ -45,7 +45,7 @@ class ManyToManyPersister extends AbstractCollectionPersister $mapping = $coll->getMapping(); $class = $this->_em->getClassMetadata(get_class($coll->getOwner())); - return 'DELETE FROM ' . $class->getQuotedJoinTableName($mapping, $this->_conn->getDatabasePlatform()) + return 'DELETE FROM ' . $this->quoteStrategy->getJoinTableName($mapping, $class) . ' WHERE ' . implode(' = ? AND ', $mapping['joinTableColumns']) . ' = ?'; } diff --git a/lib/Doctrine/ORM/Persisters/OneToManyPersister.php b/lib/Doctrine/ORM/Persisters/OneToManyPersister.php index ab586f3a3..ee807e210 100644 --- a/lib/Doctrine/ORM/Persisters/OneToManyPersister.php +++ b/lib/Doctrine/ORM/Persisters/OneToManyPersister.php @@ -45,7 +45,7 @@ class OneToManyPersister extends AbstractCollectionPersister $mapping = $coll->getMapping(); $class = $this->_em->getClassMetadata($mapping['targetEntity']); - return 'DELETE FROM ' . $class->getQuotedTableName($this->_conn->getDatabasePlatform()) + return 'DELETE FROM ' . $this->quoteStrategy->getTableName($class) . ' WHERE ' . implode('= ? AND ', $class->getIdentifierColumnNames()) . ' = ?'; } @@ -127,7 +127,7 @@ class OneToManyPersister extends AbstractCollectionPersister } $sql = 'SELECT count(*)' - . ' FROM ' . $targetClass->getQuotedTableName($this->_conn->getDatabasePlatform()) . ' t' + . ' FROM ' . $this->quoteStrategy->getTableName($targetClass) . ' t' . ' WHERE ' . implode(' AND ', $whereClauses); return $this->_conn->fetchColumn($sql, $params); @@ -204,7 +204,7 @@ class OneToManyPersister extends AbstractCollectionPersister $mapping = $coll->getMapping(); $class = $this->_em->getClassMetadata($mapping['targetEntity']); - $sql = 'DELETE FROM ' . $class->getQuotedTableName($this->_conn->getDatabasePlatform()) + $sql = 'DELETE FROM ' . $this->quoteStrategy->getTableName($class) . ' WHERE ' . implode('= ? AND ', $class->getIdentifierColumnNames()) . ' = ?'; return (bool) $this->_conn->executeUpdate($sql, $this->_getDeleteRowSQLParameters($coll, $element));