GenerateVocabsCommand.php
View source
<?php
declare (strict_types=1);
namespace Drupal\devel_generate\Command;
use Symfony\Component\Console\Attribute\Argument;
use Symfony\Component\Console\Attribute\AsCommand;
use Symfony\Component\Console\Attribute\Option;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
class GenerateVocabsCommand {
use GenerateCommandTrait;
public const NAME = 'devel-generate:vocabs';
public const PLUGIN_ID = 'vocabulary';
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',
]);
}
}