From 39b8a3e3e2cb45c8d03c2adc266847a2db98e7d1 Mon Sep 17 00:00:00 2001 From: zYne Date: Tue, 30 Oct 2007 19:19:53 +0000 Subject: [PATCH] --- lib/Doctrine/Query.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/Doctrine/Query.php b/lib/Doctrine/Query.php index 44081bba7..7d1af89ae 100644 --- a/lib/Doctrine/Query.php +++ b/lib/Doctrine/Query.php @@ -51,7 +51,7 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable 'BY', 'CHARACTER_LENGTH', 'CHAR_LENGTH', - 'CURRENT_DATE', + 'CURRENT_DATE', 'CURRENT_TIME', 'CURRENT_TIMESTAMP', 'DELETE', @@ -688,6 +688,8 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable $componentAlias = $this->getRootAlias(); } + $this->load($componentAlias); + // check the existence of the component alias if ( ! isset($this->_aliasMap[$componentAlias])) { throw new Doctrine_Query_Exception('Unknown component alias ' . $componentAlias); @@ -1463,8 +1465,11 @@ class Doctrine_Query extends Doctrine_Query_Abstract implements Countable return $this; } - public function load($path, $loadFields = true) + public function load($path, $loadFields = true) { + if (isset($this->_aliasMap[$path])) { + return $this->_aliasMap[$path]; + } $e = Doctrine_Tokenizer::quoteExplode($path, ' INDEXBY '); $mapWith = null;