AdminPageFramework_Format_SubMenuItem::get PHP Method

get() public method

public get ( )
    public function get()
    {
        $_aSubMenuItem = $this->getAsArray($this->aSubMenuItem);
        if (isset($_aSubMenuItem['page_slug'])) {
            $_oFormatter = new AdminPageFramework_Format_SubMenuPage($_aSubMenuItem, $this->oFactory, $this->iParsedIndex);
            return $_oFormatter->get();
        }
        if (isset($_aSubMenuItem['href'])) {
            $_oFormatter = new AdminPageFramework_Format_SubMenuLink($_aSubMenuItem, $this->oFactory, $this->iParsedIndex);
            return $_oFormatter->get();
        }
        return array();
    }

Usage Example

 public function _replyToRegisterSubMenuItems()
 {
     $_aPages = $this->addAndApplyFilter($this->oFactory, "pages_{$this->oFactory->oProp->sClassName}", $this->oFactory->oProp->aPages);
     $this->oFactory->oProp->sDefaultPageSlug = $this->_getDefaultPageSlug($_aPages);
     $_iParsedIndex = 0;
     $_aFormattedPages = array();
     foreach ($_aPages as $_aSubMenuItem) {
         $_oFormatter = new AdminPageFramework_Format_SubMenuItem($_aSubMenuItem, $this->oFactory, ++$_iParsedIndex);
         $_aSubMenuItem = $_oFormatter->get();
         $_aSubMenuItem['_page_hook'] = $this->_registerSubMenuItem($_aSubMenuItem);
         $_sKey = isset($_aSubMenuItem['href']) ? $_aSubMenuItem['href'] : $_aSubMenuItem['page_slug'];
         $_aFormattedPages[$_sKey] = $_aSubMenuItem;
     }
     $this->oFactory->oProp->aPages = $_aFormattedPages;
 }
All Usage Examples Of AdminPageFramework_Format_SubMenuItem::get
AdminPageFramework_Format_SubMenuItem