[DDC-551] Another batch of small refactorings
This commit is contained in:
parent
e8d30068e2
commit
f4663f4512
3 changed files with 8 additions and 11 deletions
|
@ -800,7 +800,6 @@ class EntityManager implements ObjectManager
|
|||
/**
|
||||
* Gets the enabled filters.
|
||||
*
|
||||
* @access public
|
||||
* @return FilterCollection The active filter collection.
|
||||
*/
|
||||
public function getFilters()
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue