From d8f35ee0b459d0f5e5302c66462d4ceffa91735f Mon Sep 17 00:00:00 2001 From: pookey Date: Fri, 10 Nov 2006 18:24:57 +0000 Subject: [PATCH] fixes #227 --- lib/Doctrine/RawSql.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/Doctrine/RawSql.php b/lib/Doctrine/RawSql.php index 481f3a4d8..1e6295f8f 100644 --- a/lib/Doctrine/RawSql.php +++ b/lib/Doctrine/RawSql.php @@ -196,6 +196,7 @@ class Doctrine_RawSql extends Doctrine_Hydrate { $e = explode(".", $componentName); $currPath = ''; + $table = null; foreach($e as $k => $component) { $currPath .= '.'.$component; @@ -207,7 +208,12 @@ class Doctrine_RawSql extends Doctrine_Hydrate { else $alias = $tableAlias; - $table = $this->connection->getTable($component); + if ($table) { + $t_name = $table->getAliasName($component); + $table = $this->connection->getTable($t_name); + } else { + $table = $this->connection->getTable($component); + } $this->tables[$alias] = $table; $this->fetchModes[$alias] = Doctrine::FETCH_IMMEDIATE; $this->tableAliases[$currPath] = $alias;