public function startAction()
 {
     if (!$this->getServiceLocator()->get('AuthenticationService')->hasIdentity()) {
         $this->redirect()->toRoute('login');
     }
     $menuDao = new MenuDao($this->getEntityManager());
     $favoritesMenuItems = $menuDao->getActiveFavoritesMenuItemsList();
     return new ViewModel(array('favorites' => $favoritesMenuItems));
 }
示例#2
0
 /**
  * Retorna os módulos para popular o menu conforme permições do usuário.
  * 
  * @return string html
  */
 private function getItemsMenu()
 {
     $menuDao = new MenuDao($this->getEntityManager());
     $menuItems = $menuDao->getActiveFatherMenuItemsList();
     if (count($menuItems) > 0) {
         foreach ($menuItems as $key => $menuItem) {
             $menuItems[$key]['suns'] = $menuDao->getActiveSubMenuItemsList($menuItem['id']);
         }
     }
     return $this->getOptionsMenu($menuItems);
 }