class GenerateVocabsCommand

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

Create vocabularies.

Attributes

#[AsCommand(name: self::NAME, description: 'Create vocabularies.', aliases: [ 'genv', 'devel-generate-vocabs', ], usages: [ 'devel-generate:vocabs 3 --kill', ])]

Hierarchy

Expanded class hierarchy of GenerateVocabsCommand

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

File

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

Namespace

Drupal\devel_generate\Command
View source
class GenerateVocabsCommand {
  use GenerateCommandTrait;
  public const NAME = 'devel-generate:vocabs';
  public const PLUGIN_ID = 'vocabulary';
  
  /**
   * Create vocabularies.
   *
   * The arguments and options are read from the input by the plugin.
   */
  public function __invoke(InputInterface $input, OutputInterface $output, #[Argument('Number of vocabularies to generate.')] string $num = '1', #[Option('Delete all vocabs before generating new ones.')] bool $kill = FALSE) : int {
    return $this->generate(self::PLUGIN_ID, $input, $output, [
      'taxonomy',
    ]);
  }

}

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
GenerateVocabsCommand::NAME public constant
GenerateVocabsCommand::PLUGIN_ID public constant
GenerateVocabsCommand::__invoke public function Create vocabularies.