You are here

public function MenuTreeStorageMenuHelper::getMenuLinks in Menu Trail By Path 8

Parameters

$menu_name:

Return value

\Drupal\Core\Menu\MenuLinkInterface[]

Overrides MenuHelperInterface::getMenuLinks

File

src/Menu/MenuTreeStorageMenuHelper.php, line 32

Class

MenuTreeStorageMenuHelper

Namespace

Drupal\menu_trail_by_path\Menu

Code

public function getMenuLinks($menu_name) {

  // nice to have: implement filtering like public/core/lib/Drupal/Core/Menu/MenuLinkTree.php:153
  $menu_links = [];
  $menu_plugins = $this->menuTreeStorage
    ->loadByProperties([
    'menu_name' => $menu_name,
  ]);
  foreach ($menu_plugins as $plugin_id => $definition) {
    $menu_links[$plugin_id] = $this->menuLinkManager
      ->createInstance($plugin_id);
  }
  return $menu_links;
}