This commit is contained in:
parent
b4bcc51c12
commit
6b86c9fa47
@ -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])) {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user