From f123a7cdcd086190d762352b85594871f460c107 Mon Sep 17 00:00:00 2001 From: "Jonathan.Wage" Date: Tue, 14 Aug 2007 18:25:06 +0000 Subject: [PATCH] Added extra logic to getRootAlias() so it only calles getSql() if _aliasMap is not present already --- lib/Doctrine/Hydrate.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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);