You are here

public function MenuItemExtrasCommands::clearExtraData in Menu Item Extras 8.2

Clear menu related data.

@command menu-item-extras-clear-extra-data @aliases mie:clear_data @usage mie:clear_data "main" Clear extra data for the Main menu. @usage mie:clear_data all Clear extra data for all menus.

Parameters

string $menu: Menu name.

File

src/Commands/MenuItemExtrasCommands.php, line 40

Class

MenuItemExtrasCommands
Class MenuItemExtrasCommands.

Namespace

Drupal\menu_item_extras\Commands

Code

public function clearExtraData($menu) {
  $this->menuLinkContentService
    ->clearMenuData($menu);
  if ($menu === 'all') {
    $this
      ->output()
      ->writeln('Extra data for all menus were deleted.');
  }
  else {
    $this
      ->output()
      ->writeln("Extra data for the '{$menu}' menus were deleted.");
  }
}