You are here

public function Menu::getEntityValues in Workbench Access 8

Retrieves the access control values from an entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: A Drupal entity, typically a node or a user.

Return value

array An simple array of section ids from the entity being checked.

Overrides AccessControlHierarchyInterface::getEntityValues

File

src/Plugin/AccessControlHierarchy/Menu.php, line 186

Class

Menu
Defines a hierarchy based on a Menu.

Namespace

Drupal\workbench_access\Plugin\AccessControlHierarchy

Code

public function getEntityValues(EntityInterface $entity) {
  $values = [];
  $defaults = menu_ui_get_menu_link_defaults($entity);
  if (!empty($defaults['id'])) {
    $values = [
      $defaults['id'],
    ];
  }
  return $values;
}