1
0
Fork 0
mirror of synced 2025-04-01 12:26:11 +03:00

[DDC-551] Another batch of small refactorings

This commit is contained in:
Alexander 2011-12-05 22:19:54 +01:00
parent e8d30068e2
commit f4663f4512
3 changed files with 8 additions and 11 deletions

View file

@ -800,7 +800,6 @@ class EntityManager implements ObjectManager
/**
* Gets the enabled filters.
*
* @access public
* @return FilterCollection The active filter collection.
*/
public function getFilters()

View file

@ -360,11 +360,12 @@ class ManyToManyPersister extends AbstractCollectionPersister
. $targetClass->getQuotedTableName($this->_conn->getDatabasePlatform()) . ' te'
. ' ON';
$first = true;
$joinTargetEntitySQLClauses = array();
foreach($mapping['relationToTargetKeyColumns'] as $joinTableColumn => $targetTableColumn) {
if(!$first) $joinTargetEntitySQL .= ' AND '; else $first = false;
$joinTargetEntitySQL .= ' t.' . $joinTableColumn . ' = ' . 'te.' . $targetTableColumn;
$joinTargetEntitySQLClauses[] = ' t.' . $joinTableColumn . ' = ' . 'te.' . $targetTableColumn;
}
$joinTargetEntitySQL .= implode(' AND ', $joinTargetEntitySQLClauses);
}
return array($joinTargetEntitySQL, $filterSql);

View file

@ -1502,24 +1502,21 @@ class SqlWalker implements TreeWalker
$condSql = null !== $whereClause ? $this->walkConditionalExpression($whereClause->conditionalExpression) : '';
$discrSql = $this->_generateDiscriminatorColumnConditionSql($this->_rootAliases);
$filterSql = '';
// Apply the filters for all entities in FROM
$first = true;
$filterClauses = array();
foreach ($this->_rootAliases as $dqlAlias) {
$class = $this->_queryComponents[$dqlAlias]['metadata'];
$tableAlias = $this->getSQLTableAlias($class->table['name'], $dqlAlias);
if("" !== $filterExpr = $this->generateFilterConditionSQL($class, $tableAlias)) {
if ( ! $first) $filterSql .= ' AND '; else $first = false;
$filterSql .= $filterExpr;
$filterClauses[] = $filterExpr;
}
}
if ('' !== $filterSql) {
if (count($filterClauses)) {
if($condSql) $condSql .= ' AND ';
$condSql .= $filterSql;
$condSql .= implode(' AND ', $filterClauses);
}
if ($condSql) {