diff --git a/lib/Doctrine/Hydrate.php b/lib/Doctrine/Hydrate.php index 8521c9966..f3a71ed9a 100644 --- a/lib/Doctrine/Hydrate.php +++ b/lib/Doctrine/Hydrate.php @@ -162,12 +162,24 @@ class Doctrine_Hydrate return $alias; } - - public function hasAlias($tableName) + /** + * hasTableAlias + * whether or not this object has given tableAlias + * + * @param string $tableAlias the table alias to be checked + * @return boolean true if this object has given alias, otherwise false + */ + public function hasTableAlias($tableAlias) { - return (isset($this->_tableAliases[$tableName])); + return (isset($this->_tableAliases[$tableAlias])); } - + /** + * getComponentAlias + * get component alias associated with given table alias + * + * @param string $tableAlias the table alias that identifies the component alias + * @return string component alias + */ public function getComponentAlias($tableAlias) { if ( ! isset($this->_tableAliases[$tableAlias])) { diff --git a/lib/Doctrine/Query.php b/lib/Doctrine/Query.php index 4952c4914..7f235c2d0 100644 --- a/lib/Doctrine/Query.php +++ b/lib/Doctrine/Query.php @@ -755,7 +755,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable continue; } - if($this->hasAlias($part)) { + if($this->hasTableAlias($part)) { $parts[$k] = $this->generateNewTableAlias($part); } diff --git a/lib/Doctrine/RawSql.php b/lib/Doctrine/RawSql.php index 77b3e1de2..78afcadec 100644 --- a/lib/Doctrine/RawSql.php +++ b/lib/Doctrine/RawSql.php @@ -135,7 +135,7 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract throw new Doctrine_RawSql_Exception('All selected fields in Sql query must be in format tableAlias.fieldName'); } // try to auto-add component - if ( ! $this->hasAlias($e[0])) { + if ( ! $this->hasTableAlias($e[0])) { try { $this->addComponent($e[0], ucwords($e[0])); } catch(Doctrine_Exception $exception) {