You are here

public function DevelGenerateCommands::content in Devel 8.2

Same name and namespace in other branches
  1. 8.3 devel_generate/src/Commands/DevelGenerateCommands.php \Drupal\devel_generate\Commands\DevelGenerateCommands::content()
  2. 8 devel_generate/src/Commands/DevelGenerateCommands.php \Drupal\devel_generate\Commands\DevelGenerateCommands::content()
  3. 4.x devel_generate/src/Commands/DevelGenerateCommands.php \Drupal\devel_generate\Commands\DevelGenerateCommands::content()

Create content.

@command devel-generate:content @pluginId content

@option kill Delete all content before generating new content. @option types A comma delimited list of content types to create. Defaults to page,article. @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 languages A comma-separated list of language codes @aliases genc, devel-generate-content @validate-module-enabled node

Parameters

int $num Number of nodes to generate.:

int $max_comments Maximum number of comments to generate.:

File

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

Class

DevelGenerateCommands
For commands that are parts of modules, Drush expects to find commandfiles in __MODULE__/src/Commands, and the namespace is Drupal/__MODULE__/Commands.

Namespace

Drupal\devel_generate\Commands

Code

public function content($num = 50, $max_comments = 0, $options = [
  'kill' => FALSE,
  'types' => 'page,article',
  'feedback' => 1000,
]) {
  $this
    ->generate();
}