function ContentExportCommand::configure

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/DefaultContent/ContentExportCommand.php \Drupal\Core\DefaultContent\ContentExportCommand::configure()

File

core/lib/Drupal/Core/DefaultContent/ContentExportCommand.php, line 41

Class

ContentExportCommand
Exports content entities in YAML format.

Namespace

Drupal\Core\DefaultContent

Code

protected function configure() : void {
  $this->setDescription('Exports content entities in YAML format.')
    ->addArgument('entity_type_id', InputArgument::REQUIRED, 'The entity type to export (e.g., node, taxonomy_term).')
    ->addArgument('entity_id', InputArgument::OPTIONAL, 'The ID of the entity to export. Will usually be a number.')
    ->addOption('with-dependencies', 'W', InputOption::VALUE_NONE, "Recursively export all of the entities referenced by this entity into a directory structure.")
    ->addOption('bundle', 'b', InputOption::VALUE_REQUIRED | InputOption::VALUE_IS_ARRAY, 'Only export entities of the specified bundle(s).')
    ->addOption('dir', 'd', InputOption::VALUE_REQUIRED, 'The path where content should be exported.')
    ->addUsage('node 42')
    ->addUsage('node 3 --with-dependencies --dir=/path/to/content')
    ->addUsage('media --bundle=image --dir=images')
    ->addUsage('taxonomy_term --bundle=tags --bundle=categories --dir=terms');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.