GenerateTermsCommand.php

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

Namespace

Drupal\devel_generate\Command

File

devel_generate/src/Command/GenerateTermsCommand.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 terms in specified vocabulary.
 */
class GenerateTermsCommand {
  use GenerateCommandTrait;
  public const NAME = 'devel-generate:terms';
  public const PLUGIN_ID = 'term';
  
  /**
   * Create terms in specified vocabulary.
   *
   * The arguments and options are read from the input by the plugin.
   */
  public function __invoke(InputInterface $input, OutputInterface $output, #[Argument('Number of terms to generate.')] string $num = '50', #[Option('Delete all terms in these vocabularies before generating new ones.')] bool $kill = FALSE, #[Option('A comma-delimited list of machine names for the vocabularies where terms will be created.')] ?string $bundles = NULL, #[Option('An integer representing interval for insertion rate logging.')] string $feedback = '1000', #[Option('A comma-separated list of language codes')] ?string $languages = NULL, #[Option('A comma-separated list of language codes for translations.')] ?string $translations = NULL, #[Option('The minimum depth of hierarchy for the new terms.')] string $minDepth = '1', #[Option('The maximum depth of hierarchy for the new terms.')] string $maxDepth = '4') : int {
    return $this->generate(self::PLUGIN_ID, $input, $output);
  }

}

Classes

Title Deprecated Summary
GenerateTermsCommand Create terms in specified vocabulary.