You are here

public function DefaultContentCommands::contentExportModule in Default Content for D8 8

Same name and namespace in other branches
  1. 2.0.x src/Commands/DefaultContentCommands.php \Drupal\default_content\Commands\DefaultContentCommands::contentExportModule()

Exports all the content defined in a module info file.

@command default-content:export-module @aliases dcem

Parameters

string $module: The name of the module.

File

src/Commands/DefaultContentCommands.php, line 91

Class

DefaultContentCommands
Class DefaultContentCommands.

Namespace

Drupal\default_content\Commands

Code

public function contentExportModule($module) {
  $serialized_by_type = $this->defaultContentExporter
    ->exportModuleContent($module);
  $module_folder = \Drupal::moduleHandler()
    ->getModule($module)
    ->getPath() . '/content';
  $this->defaultContentExporter
    ->writeDefaultContent($serialized_by_type, $module_folder);
}