You are here

public function MiconMenuServiceProvider::alter in Micon 8

Same name and namespace in other branches
  1. 2.x micon_menu/src/MiconMenuServiceProvider.php \Drupal\micon_menu\MiconMenuServiceProvider::alter()

Modifies existing service definitions.

Parameters

ContainerBuilder $container: The ContainerBuilder whose service definitions can be altered.

Overrides ServiceProviderBase::alter

File

micon_menu/src/MiconMenuServiceProvider.php, line 16

Class

MiconMenuServiceProvider
Modifies the language manager service.

Namespace

Drupal\micon_menu

Code

public function alter(ContainerBuilder $container) {

  // Overrides plugin.manager.menu.link class so that we can save the icon
  // to the menu item options.
  $definition = $container
    ->getDefinition('plugin.manager.menu.link');
  $definition
    ->setClass('Drupal\\micon_menu\\MiconMenuLinkManager');

  // Overrides menu_link.static.overrides service so that we can save
  // options statically.
  $definition = $container
    ->getDefinition('menu_link.static.overrides');
  $definition
    ->setClass('Drupal\\micon_menu\\MiconStaticMenuLinkOverrides');
}