diff --git a/lib/Doctrine/Relation/Association/Self.php b/lib/Doctrine/Relation/Association/Self.php index 850959ced..358b9c561 100644 --- a/lib/Doctrine/Relation/Association/Self.php +++ b/lib/Doctrine/Relation/Association/Self.php @@ -93,9 +93,9 @@ class Doctrine_Relation_Association_Self extends Doctrine_Relation_Association ' = ?'; $q->select('{'.$tableName.'.*}, {'.$assocTable.'.*}') - ->from($tableName.' INNER JOIN '.$assocTable.' ON '. - $tableName.'.'.$identifier.' = '.$assocTable.'.'.$this->getLocal().' OR '. - $tableName.'.'.$identifier.' = '.$assocTable.'.'.$this->getForeign() + ->from($tableName . ' INNER JOIN '.$assocTable.' ON '. + $tableName . '.' . $identifier . ' = ' . $assocTable . '.' . $this->getLocal() . ' OR ' . + $tableName . '.' . $identifier . ' = ' . $assocTable . '.' . $this->getForeign() ) ->where($tableName.'.'.$identifier.' IN ('.$sub.') OR '. $tableName.'.'.$identifier.' IN ('.$sub2.')'