function DevelGenerateCommands::blockContent

Create Block content blocks.

Attributes

#[CLI\Command(name: self::BLOCK_CONTENT, aliases: [ 'genbc', 'devel-generate-block-content', ])] #[CLI\ValidateModulesEnabled(modules: [ 'block_content', ])] #[CLI\Argument(name: 'num', description: 'Number of blocks to generate.')] #[CLI\Option(name: 'kill', description: 'Delete all block content before generating new.')] #[CLI\Option(name: 'block_types', description: 'A comma-delimited list of block content types to create.')] #[CLI\Option(name: 'authors', description: 'A comma delimited list of authors ids. Defaults to all users.')] #[CLI\Option(name: 'feedback', description: 'An integer representing interval for insertion rate logging.')] #[CLI\Option(name: 'skip-fields', description: 'A comma delimited list of fields to omit when generating random values')] #[CLI\Option(name: 'base-fields', description: 'A comma delimited list of base field names to populate')] #[CLI\Option(name: 'languages', description: 'A comma-separated list of language codes')] #[CLI\Option(name: 'translations', description: 'A comma-separated list of language codes for translations.')] #[CLI\Option(name: 'add-type-label', description: 'Add the block type label to the front of the node title')] #[CLI\Option(name: 'reusable', description: 'Create re-usable blocks. Disable for inline Layout Builder blocks, for example.')] #[Generator(id: 'block_content')]

File

devel_generate/src/Drush/Commands/DevelGenerateCommands.php, line 201

Class

DevelGenerateCommands
Provide Drush commands for all the core Devel Generate plugins.

Namespace

Drupal\devel_generate\Drush\Commands

Code

public function blockContent(?string $num = '50', array $options = [
  'kill' => FALSE,
  'block_types' => 'basic',
  'feedback' => 1000,
  'skip-fields' => self::REQ,
  'base-fields' => self::REQ,
  'languages' => self::REQ,
  'translations' => self::REQ,
  'add-type-label' => FALSE,
  'reusable' => TRUE,
]) : void {
  $this->generate();
}