From f7175c229ee85e33102066d9740d5c385cd683f7 Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Sun, 11 Dec 2011 18:39:04 +0100 Subject: [PATCH] DDC-551 - Fix some ugly yoda conditions and a wrong nesting. --- lib/Doctrine/ORM/Persisters/BasicEntityPersister.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php index 9ce8acc69..40ccf91d0 100644 --- a/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php +++ b/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php @@ -903,7 +903,7 @@ class BasicEntityPersister $alias = $this->_getSQLTableAlias($this->_class->name); - if ('' !== $filterSql = $this->generateFilterConditionSQL($this->_class, $alias)) { + if ($filterSql = $this->generateFilterConditionSQL($this->_class, $alias)) { if ($conditionSql) { $conditionSql .= ' AND '; } @@ -1025,11 +1025,11 @@ class BasicEntityPersister $this->_selectJoinSql .= ' ' . $this->getJoinSQLForJoinColumns($assoc['joinColumns']); $this->_selectJoinSql .= ' ' . $eagerEntity->getQuotedTableName($this->_platform) . ' ' . $this->_getSQLTableAlias($eagerEntity->name, $assocAlias) .' ON '; + $tableAlias = $this->_getSQLTableAlias($assoc['targetEntity'], $assocAlias); foreach ($assoc['sourceToTargetKeyColumns'] AS $sourceCol => $targetCol) { if ( ! $first) { $this->_selectJoinSql .= ' AND '; } - $tableAlias = $this->_getSQLTableAlias($assoc['targetEntity'], $assocAlias); $this->_selectJoinSql .= $this->_getSQLTableAlias($assoc['sourceEntity']) . '.' . $sourceCol . ' = ' . $tableAlias . '.' . $targetCol; $first = false;