You are here

public function MenuConfigurationHandler::onMenuLinkLoad in Configuration Management 7.3

File

src/Handlers/MenuConfigurationHandler.php, line 54

Class

MenuConfigurationHandler

Namespace

Configuration\Handlers

Code

public function onMenuLinkLoad($event) {
  $menu_link = $event->configuration
    ->getData();

  // Only for menu links in the parent level
  if (empty($menu_link['plid'])) {
    $menu_name = 'menu.' . str_replace('-', '_', $menu_link['menu_name']);
    $this->configuration_manager
      ->newDependency($event->configuration, $menu_name);
  }
}