diff --git a/lib/Doctrine/Hydrate.php b/lib/Doctrine/Hydrate.php index 6c5037af5..02024ed09 100644 --- a/lib/Doctrine/Hydrate.php +++ b/lib/Doctrine/Hydrate.php @@ -179,8 +179,11 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable */ public function getRootAlias() { - $this->getSql(); - + if( !$this->_aliasMap ) + { + $this->getSql(); + } + reset($this->_aliasMap); return key($this->_aliasMap);