GenerateVocabsCommand.php

Same filename in this branch
  1. 5.x devel_generate/src/Drush/Commands/GenerateVocabsCommand.php

Namespace

Drupal\devel_generate\Command

File

devel_generate/src/Command/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;

/**
 * Create vocabularies.
 */
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',
    ]);
  }

}

Classes

Title Deprecated Summary
GenerateVocabsCommand Create vocabularies.