src/components/AdminMenu.php
public function getMenu()
    {
        if ($this->_menu !== null) {
            return $this->_menu;
        }
        
        $menu = [];
        foreach ($this->getAdminModuleMenus() as $menuBuilder) {
            // removed legacy support, menu must be instance of AdminmenuBuilderInterface
            if (!$menuBuilder instanceof AdminMenuBuilderInterface) {
                throw new Exception("admin menu must be instance of AdminMenuBuilderInterface");
            }
            // call the interface menu method returns the array for the given Module.
            $data = $menuBuilder->menu();
            $menu = ArrayHelper::merge($data, $menu);
        }
        
        $this->_menu = $menu;

        return $menu;
    }
public function getMenu()
    {
        if ($this->_menu !== null) {
            return $this->_menu;
        }
        
        $menu = [];
        foreach ($this->getAdminModuleMenus() as $menuBuilder) {
            // removed legacy support, menu must be instance of AdminmenuBuilderInterface
            if (!$menuBuilder instanceof AdminMenuBuilderInterface) {
                throw new Exception("admin menu must be instance of AdminMenuBuilderInterface");
            }
            // call the interface menu method returns the array for the given Module.
            $data = $menuBuilder->menu();
            $menu = ArrayHelper::merge($data, $menu);
        }
        
        $this->_menu = $menu;

        return $menu;
    }
public function getMenu ( ) { if ( $ this -> _menu !== null ) { return $ this -> _menu ; } $ menu = [ ] ; foreach ( $ this -> getAdminModuleMenus ( ) as $ menuBuilder ) { // removed legacy support, menu must be instance of AdminmenuBuilderInterface if ( ! $ menuBuilder instanceof AdminMenuBuilderInterface ) { throw new Exception ( "admin menu must be instance of AdminMenuBuilderInterface" ) ; } // call the interface menu method returns the array for the given Module. $ data = $ menuBuilder -> menu ( ) ; $ menu = ArrayHelper :: merge ( $ data , $ menu ) ; } $ this -> _menu = $ menu ; return $ menu ; }
Return the menu array entries from all registered admin modules.

Response array is organized as follow:

+ Node (Root level menu)
+ Group
+ Items

Example array response:

```php
Array (
[id] => 1, // auto assigned
[moduleId] => admin
[template] =>
[routing] => default
[alias] => menu_node_system
[icon] => layers
[permissionRoute] =>
[permissionIsRoute] =>
[searchModelClass] =>
[groups] => Array ( // Optional
[menu_group_access] => Array  (
[name] => menu_group_access
[items] => Array  (
[0] => Array (
[alias] => menu_access_item_user
[route] => admin/user/index
[icon] => person
[permissionApiEndpoint] => api-admin-user
[permissionIsRoute] =>
[permissionIsApi] => 1
[searchModelClass] =>
[options] => Array ()
)
[1] => Array  (
[alias] => menu_access_item_group
[route] => admin/group/index
[icon] => group
[permissionApiEndpoint] => api-admin-group
[permissionIsRoute] =>
[permissionIsApi] => 1
[searchModelClass] =>
[options] => Array ( )
)
)
)
)
```

@return array
Return the menu array entries from all registered admin modules .