1
0
mirror of synced 2025-03-27 18:33:53 +03:00

use quote strategy in OneToManyPersister

This commit is contained in:
Fabio B. Silva 2012-06-04 12:58:51 -03:00
parent 36296a3906
commit dcd19bba22
2 changed files with 4 additions and 4 deletions

View File

@ -45,7 +45,7 @@ class ManyToManyPersister extends AbstractCollectionPersister
$mapping = $coll->getMapping(); $mapping = $coll->getMapping();
$class = $this->_em->getClassMetadata(get_class($coll->getOwner())); $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']) . ' = ?'; . ' WHERE ' . implode(' = ? AND ', $mapping['joinTableColumns']) . ' = ?';
} }

View File

@ -45,7 +45,7 @@ class OneToManyPersister extends AbstractCollectionPersister
$mapping = $coll->getMapping(); $mapping = $coll->getMapping();
$class = $this->_em->getClassMetadata($mapping['targetEntity']); $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()) . ' = ?'; . ' WHERE ' . implode('= ? AND ', $class->getIdentifierColumnNames()) . ' = ?';
} }
@ -127,7 +127,7 @@ class OneToManyPersister extends AbstractCollectionPersister
} }
$sql = 'SELECT count(*)' $sql = 'SELECT count(*)'
. ' FROM ' . $targetClass->getQuotedTableName($this->_conn->getDatabasePlatform()) . ' t' . ' FROM ' . $this->quoteStrategy->getTableName($targetClass) . ' t'
. ' WHERE ' . implode(' AND ', $whereClauses); . ' WHERE ' . implode(' AND ', $whereClauses);
return $this->_conn->fetchColumn($sql, $params); return $this->_conn->fetchColumn($sql, $params);
@ -204,7 +204,7 @@ class OneToManyPersister extends AbstractCollectionPersister
$mapping = $coll->getMapping(); $mapping = $coll->getMapping();
$class = $this->_em->getClassMetadata($mapping['targetEntity']); $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()) . ' = ?'; . ' WHERE ' . implode('= ? AND ', $class->getIdentifierColumnNames()) . ' = ?';
return (bool) $this->_conn->executeUpdate($sql, $this->_getDeleteRowSQLParameters($coll, $element)); return (bool) $this->_conn->executeUpdate($sql, $this->_getDeleteRowSQLParameters($coll, $element));