Commit 6b86c9fa authored by zYne's avatar zYne

--no commit message

--no commit message
parent b4bcc51c
...@@ -162,12 +162,24 @@ class Doctrine_Hydrate ...@@ -162,12 +162,24 @@ class Doctrine_Hydrate
return $alias; 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) public function getComponentAlias($tableAlias)
{ {
if ( ! isset($this->_tableAliases[$tableAlias])) { if ( ! isset($this->_tableAliases[$tableAlias])) {
......
...@@ -755,7 +755,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable ...@@ -755,7 +755,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable
continue; continue;
} }
if($this->hasAlias($part)) { if($this->hasTableAlias($part)) {
$parts[$k] = $this->generateNewTableAlias($part); $parts[$k] = $this->generateNewTableAlias($part);
} }
......
...@@ -135,7 +135,7 @@ class Doctrine_RawSql extends Doctrine_Query_Abstract ...@@ -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'); throw new Doctrine_RawSql_Exception('All selected fields in Sql query must be in format tableAlias.fieldName');
} }
// try to auto-add component // try to auto-add component
if ( ! $this->hasAlias($e[0])) { if ( ! $this->hasTableAlias($e[0])) {
try { try {
$this->addComponent($e[0], ucwords($e[0])); $this->addComponent($e[0], ucwords($e[0]));
} catch(Doctrine_Exception $exception) { } catch(Doctrine_Exception $exception) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment