You are here

protected function MenuItemRoleAccessLinkTreeManipulator::loadByUuid in Menu Item Role Access 8

Same name and namespace in other branches
  1. 8.2 src/MenuItemRoleAccessLinkTreeManipulator.php \Drupal\menu_item_role_access\MenuItemRoleAccessLinkTreeManipulator::loadByUuid()

Get the loaded menu item entity by a combined UUID string.

The combined UUID string is the entity bundle followed by a semicolon and then the UUID. For example:

  • menu_link_content:ab1cd23f-4567-890e-fg12-34h56i789j01

Parameters

string $uuid: The combined UUID string.

Return value

\Drupal\menu_link_content\Entity\MenuLinkContent|bool The menu link, or FALSE if there is no menu item with the given UUID.

1 call to MenuItemRoleAccessLinkTreeManipulator::loadByUuid()
MenuItemRoleAccessLinkTreeManipulator::getOverridingParent in src/MenuItemRoleAccessLinkTreeManipulator.php
Get the first parent that overrides the childrens' settings.

File

src/MenuItemRoleAccessLinkTreeManipulator.php, line 187

Class

MenuItemRoleAccessLinkTreeManipulator
Defines the access control handler for the menu item.

Namespace

Drupal\menu_item_role_access

Code

protected function loadByUuid($uuid) {
  $uuid_fragments = explode(':', $uuid);

  // Make sure we have a valid UUID.
  if (strpos($uuid, ':') !== FALSE && count($uuid_fragments) == 2) {
    return $this->entityRepository
      ->loadEntityByUuid($uuid_fragments[0], $uuid_fragments[1]);
  }
  return FALSE;
}