1
0
mirror of synced 2025-01-19 15:01:40 +03:00

added getRoot

This commit is contained in:
zYne 2007-06-18 23:42:30 +00:00
parent 98c0d772d6
commit ab530652bb

View File

@ -147,7 +147,28 @@ class Doctrine_Hydrate extends Doctrine_Object implements Serializable
} }
$this->_conn = $connection; $this->_conn = $connection;
} }
/**
* getRoot
* returns the root component for this object
*
* @return Doctrine_Table root components table
*/
public function getRoot()
{
$map = reset($this->_aliasMap);
if ( ! isset($map['table'])) {
throw new Doctrine_Hydrate_Exception('Root component not initialized.');
}
return $map['table'];
}
/**
* getSql
* return the sql associated with this object
*
* @return string sql query string
*/
public function getSql() public function getSql()
{ {
return $this->getQuery(); return $this->getQuery();