class GenerateMenusCommand

Same name in this branch
  1. 5.x devel_generate/src/Drush/Commands/GenerateMenusCommand.php \Drupal\devel_generate\Drush\Commands\GenerateMenusCommand

Create menus.

Attributes

#[AsCommand(name: self::NAME, description: 'Create menus.', aliases: [ 'genm', 'devel-generate-menus', ], usages: [ 'devel-generate:menus 2 50 --kill', ])]

Hierarchy

Expanded class hierarchy of GenerateMenusCommand

2 files declare their use of GenerateMenusCommand
GenerateCommandsKernelTest.php in devel_generate/tests/src/Kernel/GenerateCommandsKernelTest.php
GenerateMenusCommand.php in devel_generate/src/Drush/Commands/GenerateMenusCommand.php

File

devel_generate/src/Command/GenerateMenusCommand.php, line 16

Namespace

Drupal\devel_generate\Command
View source
class GenerateMenusCommand {
  use GenerateCommandTrait;
  public const NAME = 'devel-generate:menus';
  public const PLUGIN_ID = 'menu';
  
  /**
   * Create menus.
   *
   * The arguments and options are read from the input by the plugin.
   */
  public function __invoke(InputInterface $input, OutputInterface $output, #[Argument('Number of menus to generate.', name: 'number_menus')] string $numberMenus = '2', #[Argument('Number of links to generate.', name: 'number_links')] string $numberLinks = '50', #[Argument('Max link depth.', name: 'max_depth')] string $maxDepth = '3', #[Argument('Max width of first level of links.', name: 'max_width')] string $maxWidth = '8', #[Option('Delete any menus and menu links previously created by devel_generate before generating new ones.')] bool $kill = FALSE) : int {
    return $this->generate(self::PLUGIN_ID, $input, $output);
  }

}

Members

Title Sort descending Modifiers Object type Summary
GenerateCommandTrait::generate protected function Generates with the given plugin, from the command's arguments and options.
GenerateCommandTrait::processBatch protected function Runs the batch that a plugin has set, if any, in this process.
GenerateCommandTrait::writeMessages protected function Writes the messages that the plugin has set, and clears them.
GenerateCommandTrait::__construct public function
GenerateMenusCommand::NAME public constant
GenerateMenusCommand::PLUGIN_ID public constant
GenerateMenusCommand::__invoke public function Create menus.