class GenerateVocabsCommand
Attributes
#[AsCommand(name: 'devel-generate:vocabs', description: 'Create vocabularies.', aliases: [
'genv',
'devel-generate-vocabs',
])]
#[CLI\ValidateModulesEnabled(modules: [
'taxonomy',
])]
Hierarchy
- class \Drupal\devel_generate\Drush\Commands\GenerateVocabsCommand uses \Drush\Commands\AutowireTrait extends \Symfony\Component\Console\Command\Command
Expanded class hierarchy of GenerateVocabsCommand
File
-
devel_generate/
src/ Drush/ Commands/ GenerateVocabsCommand.php, line 17
Namespace
Drupal\devel_generate\Drush\CommandsView source
final class GenerateVocabsCommand extends Command {
use AutowireTrait;
const PLUGIN_ID = 'vocabulary';
public function __construct(protected DevelGeneratePluginManager $manager) {
parent::__construct();
}
protected function configure() : void {
$this->addArgument('num', InputArgument::OPTIONAL, 'Number of vocabularies to generate.', '1')
->addOption('kill', NULL, InputOption::VALUE_NONE, 'Delete all vocabs before generating new ones.');
}
public function execute(InputInterface $input, OutputInterface $output) : int {
/** @var \Drupal\devel_generate\DevelGenerateBaseInterface $instance */
$instance = $this->manager
->createInstance(self::PLUGIN_ID, []);
$parameters = $instance->validateDrushParams($input->getArguments(), $input->getOptions());
$instance->generate($parameters);
return Command::SUCCESS;
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary |
|---|---|---|---|
| GenerateVocabsCommand::configure | protected | function | |
| GenerateVocabsCommand::execute | public | function | |
| GenerateVocabsCommand::PLUGIN_ID | constant | ||
| GenerateVocabsCommand::__construct | public | function |