You are here

public function MenuTreeStorage::load in Drupal 8

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Menu/MenuTreeStorage.php \Drupal\Core\Menu\MenuTreeStorage::load()

Loads a menu link plugin definition from the storage.

Parameters

string $id: The menu link plugin ID.

Return value

array|false The plugin definition, or FALSE if no definition was found for the ID.

Overrides MenuTreeStorageInterface::load

File

core/lib/Drupal/Core/Menu/MenuTreeStorage.php, line 727

Class

MenuTreeStorage
Provides a menu tree storage using the database.

Namespace

Drupal\Core\Menu

Code

public function load($id) {
  if (isset($this->definitions[$id])) {
    return $this->definitions[$id];
  }
  $loaded = $this
    ->loadMultiple([
    $id,
  ]);
  return isset($loaded[$id]) ? $loaded[$id] : FALSE;
}