diff options
Diffstat (limited to 'LibertyStructure.php')
| -rw-r--r-- | LibertyStructure.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/LibertyStructure.php b/LibertyStructure.php index f33c509..e8a9ce3 100644 --- a/LibertyStructure.php +++ b/LibertyStructure.php @@ -24,6 +24,7 @@ class LibertyStructure extends LibertyBase { parent::__construct(); $this->mStructureId = $pStructureId; $this->mContentId = $pContentId; + $this->load(); } function load( $pContentId=NULL ) { @@ -127,6 +128,22 @@ class LibertyStructure extends LibertyBase { * @access public * @return TRUE on success, FALSE on failure - mErrors will contain reason for failure */ + function getRootObject() { + $ret = NULL; + if( !empty( $this->mInfo['root_structure_id'] ) ) { + if( $rootHash = $this->mDb->getRow( "SELECT * FROM `".BIT_DB_PREFIX."liberty_structures` WHERE `structure_id` = ?", array( $this->mInfo['root_structure_id'] ) ) ) { + $ret = $this->getLibertyObject( $rootHash['content_id'] ); + } + } + return $ret; + } + + /** + * get the title of the root node + * + * @access public + * @return TRUE on success, FALSE on failure - mErrors will contain reason for failure + */ function getRootTitle() { $ret = NULL; if( isset( $this->mInfo['structure_path'][0]['title'] ) ) { |
