function DevelGenerateCommands::content

Same name in this branch
  1. 5.x devel_generate/src/Drush/Commands/DevelGenerateCommands.php \Drupal\devel_generate\Drush\Commands\DevelGenerateCommands::content()
Same name in other branches
  1. 8.x-1.x devel_generate/src/Commands/DevelGenerateCommands.php \Drupal\devel_generate\Commands\DevelGenerateCommands::content()
  2. 4.x devel_generate/src/Commands/DevelGenerateCommands.php \Drupal\devel_generate\Commands\DevelGenerateCommands::content()

Create content.

@command devel-generate:content @aliases genc, devel-generate-content @pluginId content @validate-module-enabled node

@option kill Delete all content before generating new content. @option bundles A comma-delimited list of content types to create. @option authors A comma delimited list of authors ids. Defaults to all users. @option feedback An integer representing interval for insertion rate logging. @option skip-fields A comma delimited list of fields to omit when generating random values @option base-fields A comma delimited list of base field names to populate @option languages A comma-separated list of language codes @option translations A comma-separated list of language codes for translations. @option add-type-label Add the content type label to the front of the node title

Parameters

int $num: Number of nodes to generate.

int $max_comments: Maximum number of comments to generate.

array $options: Array of options as described below.

File

devel_generate/src/Commands/DevelGenerateCommands.php, line 231

Class

DevelGenerateCommands
Provide Drush commands for all the Devel Generate processes.

Namespace

Drupal\devel_generate\Commands

Code

public function content($num = 50, $max_comments = 0, array $options = [
    'kill' => FALSE,
    'bundles' => 'page,article',
    'authors' => self::REQ,
    'feedback' => 1000,
    'skip-fields' => self::REQ,
    'base-fields' => self::REQ,
    'languages' => self::REQ,
    'translations' => self::REQ,
    'add-type-label' => FALSE,
]) {
    $this->generate();
}