PHP 클래스 Devise\Menus\MenusRepository

파일 보기 프로젝트 열기: devisephp/cms

공개 메소드들

메소드 설명
__construct ( DvsMenu $Menu, DvsMenuItem $MenuItem, LanguageDetector $LanguageDetector, UserHelper $UserHelper, Framework $Framework )
buildMenu ( $name, integer $depth = 2, null $page = null ) : mixed Build a menu from it's name
findById ( $id ) : DvsMenu Finds DvsMenu by an integer id
findMenuByName ( string $name ) : array Find menu using name value
getChildrenMenuItems ( $name ) : array Get the children menu items of a menu name
getSiblingMenuItems ( $name ) : array Get menu siblings
menuStructure ( DvsMenu | DvsMenuItem $menu, boolean $isRootMenu = true ) : array A simple way to view the menu structure not in use by anything right now but here for troubleshooting menus if we need to
menus ( ) : Collection Returns a Collection of DvsMenus

비공개 메소드들

메소드 설명
checkMenuItemPermission ( $permission ) : boolean Tells us whether or not the menu item is supposed to be shown to this user
childrenLoaded ( MenuItem $item ) : boolean checks if the children relation has been lazy loaded the goal is to respect the 'depth' value requested when the menu was built
getAllowedMenuItems ( DvsMenuItem $menuItem ) : DvsMenuItem | false This will let us know if the menu item is allowed and it also traverses all it's children (and future generations) filtering out menu items that are not allowed
getAllowedMenuItemsFromMenu ( DvsMenu $menu ) : Collection This gets us all the allowed menu items from a particular menu.
getLazyLoadByDepth ( $startingRelation, $depth ) : string generates the lazy load string based off the requested depth
getTranslation ( $menu ) : mixed Translate the menu if needed
locateCurrentMenuItem ( $pageId, $menuItems ) : boolean recursively traverses the menu items and their children finds the item that matches the current page, marks it as an 'activeItem' and marks it's parents as 'activeAncestor'
traverseMenu ( $menu, $depth, $page ) : mixed Traverses the menu recursively finding sub menus

메소드 상세

__construct() 공개 메소드

public __construct ( DvsMenu $Menu, DvsMenuItem $MenuItem, LanguageDetector $LanguageDetector, UserHelper $UserHelper, Framework $Framework )
$Menu DvsMenu
$MenuItem DvsMenuItem
$LanguageDetector Devise\Languages\LanguageDetector
$UserHelper Devise\Users\UserHelper
$Framework Devise\Support\Framework

buildMenu() 공개 메소드

Build a menu from it's name
public buildMenu ( $name, integer $depth = 2, null $page = null ) : mixed
$name
$depth integer
$page null
리턴 mixed

findById() 공개 메소드

Finds DvsMenu by an integer id
public findById ( $id ) : DvsMenu
$id
리턴 DvsMenu

findMenuByName() 공개 메소드

Find menu using name value
public findMenuByName ( string $name ) : array
$name string Human readable name of link
리턴 array

getChildrenMenuItems() 공개 메소드

Get the children menu items of a menu name
public getChildrenMenuItems ( $name ) : array
$name
리턴 array

getSiblingMenuItems() 공개 메소드

Get menu siblings
public getSiblingMenuItems ( $name ) : array
$name
리턴 array

menuStructure() 공개 메소드

A simple way to view the menu structure not in use by anything right now but here for troubleshooting menus if we need to
public menuStructure ( DvsMenu | DvsMenuItem $menu, boolean $isRootMenu = true ) : array
$menu DvsMenu | DvsMenuItem
$isRootMenu boolean
리턴 array

menus() 공개 메소드

Returns a Collection of DvsMenus
public menus ( ) : Collection
리턴 Illuminate\Support\Collection