You are here

function menu_item_extras_menu_insert in Menu Item Extras 8.2

Implements hook_menu_insert().

File

./menu_item_extras.module, line 305
Manage fields for the menu items.

Code

function menu_item_extras_menu_insert(EntityInterface $entity) {

  /** @var \Drupal\menu_item_extras\Service\MenuLinkContentService $mlc_helper */
  $mlc_helper = \Drupal::service('menu_item_extras.menu_link_content_helper');
  $mlc_helper
    ->installViewModeField();
  $mlc_helper
    ->updateMenuItemsBundle($entity
    ->id());
  $mlc_helper
    ->doEntityUpdate();
}