MenuHandler
class MenuHandler
Class MenuHandler
Traits
Constants
DUPLICATE_RETRY_CNT |
Limit count of retry for ID duplicated |
ACCESS |
Access action keyword for permission |
VISIBLE |
Visible action keyword for permission |
Properties
protected MenuRepository | $menus | MenuRepository instance | |
protected MenuItemRepository | $items | MenuItemRepository instance | |
protected ConfigManager | $configs | ConfigManager instance | |
protected ModuleHandler | $modules | ModuleHandler instance | |
protected RouteRepository | $routes | RouteRepository instance | |
protected string | $menuKeyword | Menu keyword for config |
Methods
MenuHandler constructor.
Create new menu
Update menu type associated with the menu item.
Set menu config consisting of theme identifiers
Update menu config consisting of theme identifiers
Set menu config consisting of theme identifiers
Update menu item config consisting of theme identifiers
Move menu item config consisting of theme identifiers
Get default grant
Get setting page url by menu item id
Get ModuleHandler instance
Get MenuRepository instance
Get MenuItemRepository instance
Details
in NodePositionTrait at line 36
protected bool
linkHierarchy(Node $item, Node $parent)
Linked parent and child relation
in NodePositionTrait at line 69
protected int
unlinkHierarchy(Node $item, Node $parent)
unlinked parent and child relation
in NodePositionTrait at line 95
void
setOrder(Node $item, int|null $position = null)
Set item ordering value
at line 115
__construct(MenuRepository $menus, MenuItemRepository $items, ConfigManager $configs, ModuleHandler $modules, RouteRepository $routes)
MenuHandler constructor.
at line 138
Menu
get(string $id, array $with = array())
Get menu
at line 152
Menu[]
getAll(string $siteKey, array $with = array())
Get all menu
at line 165
Menu
create(array $attributes)
Create new menu
at line 176
Menu
createMenu(array $attributes)
Create new menu
at line 216
bool
remove(Menu $menu)
Delete menu
at line 228
bool
deleteMenu(Menu $menu)
Delete menu
at line 248
MenuItem
getItem(string $id, array $with = array())
Get menu item
at line 262
MenuItem[]
getItemIn(array $ids, array $with = array())
Get menu item list by identifiers
at line 275
MenuItem
createItem(Menu $menu, array $attributes, array $menuTypeInput = array())
Create new menu item
at line 295
protected void
setHierarchy(MenuItem $item)
Set hierarchy information for new item
at line 311
protected void
storeMenuType(MenuItem $item, array $menuTypeInput)
Store menu type associated with the menu item.
at line 350
MenuItem
updateItem(MenuItem $item, array $attributes, array $menuTypeInput = array())
Update menu item
at line 373
protected void
updateMenuType(MenuItem $item, array $menuTypeInput)
Update menu type associated with the menu item.
at line 395
bool|null
removeItem(MenuItem $item)
Delete menu item
at line 407
bool|null
deleteItem(MenuItem $item)
Delete menu item
at line 424
protected void
deleteMenuType(MenuItem $item)
Delete menu type associated with the menu item.
at line 478
void
setMenuTheme(Menu $menu, string $desktopTheme, string $mobileTheme)
Set menu config consisting of theme identifiers
at line 495
ConfigEntity
getMenuTheme(Menu $menu)
Get menu config consisting of theme identifiers
at line 508
void
updateMenuTheme(Menu $menu, string $desktopTheme, string $mobileTheme)
Update menu config consisting of theme identifiers
at line 525
void
deleteMenuTheme(Menu $menu)
Delete menu config consisting of theme identifiers
at line 538
void
setMenuItemTheme(MenuItem $item, string $desktopTheme, string $mobileTheme)
Set menu config consisting of theme identifiers
at line 555
ConfigEntity
getMenuItemTheme(MenuItem $item)
Get menu item config consisting of theme identifiers
at line 570
void
updateMenuItemTheme(MenuItem $item, string $desktopTheme, string $mobileTheme)
Update menu item config consisting of theme identifiers
at line 587
void
deleteMenuItemTheme(MenuItem $item)
Delete menu item config consisting of theme identifiers
at line 599
void
moveItemConfig(MenuItem $beforeItem, MenuItem $movedItem)
Move menu item config consisting of theme identifiers
at line 613
protected string
menuKeyString(MenuItem|string $value)
Make key string for config
at line 630
Grant
getDefaultGrant()
Get default grant
at line 653
string
permKeyString(MenuItem $item)
Make key string for permission
at line 666
string|null
getInstanceSettingURI(MenuItem $item)
Get setting page url by menu item
at line 679
string|null
getInstanceSettingURIByItemId(string $itemId)
Get setting page url by menu item id
at line 693
ModuleHandler
getModuleHandler()
Get ModuleHandler instance
at line 703
MenuRepository
menus()
Get MenuRepository instance
at line 713
MenuItemRepository
items()
Get MenuItemRepository instance