You are here

public function AccordionMenusBlock::isAccordionMenusLinkInaccessible in Accordion Menus 8.4

Same name and namespace in other branches
  1. 8.3 src/Plugin/Block/AccordionMenusBlock.php \Drupal\accordion_menus\Plugin\Block\AccordionMenusBlock::isAccordionMenusLinkInaccessible()

Validate of the menu item accessibility.

Parameters

array $item: Menu item object.

Return value

boolean Return a bool result about is the menu link is inaccessible.

2 calls to AccordionMenusBlock::isAccordionMenusLinkInaccessible()
AccordionMenusBlock::build in src/Plugin/Block/AccordionMenusBlock.php
Builds and returns the renderable array for this block plugin.
AccordionMenusBlock::generateSubMenuTree in src/Plugin/Block/AccordionMenusBlock.php
Generate submenu output.

File

src/Plugin/Block/AccordionMenusBlock.php, line 177

Class

AccordionMenusBlock
Provides a accordion Menu block.

Namespace

Drupal\accordion_menus\Plugin\Block

Code

public function isAccordionMenusLinkInaccessible($item) {
  if (!$item->link
    ->isEnabled() || $item->access !== NULL && !$item->access instanceof AccessResultInterface || $item->access instanceof AccessResultInterface && !$item->access
    ->isAllowed()) {
    return TRUE;
  }
  return FALSE;
}