You are here

function drush_default_content_export in Default Content for D8 2.0.x

Same name and namespace in other branches
  1. 8 drush/default_content.drush.inc \drush_default_content_export()

Exports a piece of content into the stdout or into a file.

Parameters

string $entity_type_id: The entity type ID.

mixed $entity_id: The entity ID to export.

File

drush/default_content.drush.inc, line 56
Drush integration for the default_content module.

Code

function drush_default_content_export($entity_type_id, $entity_id) {

  /** @var \Drupal\default_content\ExporterInterface $exporter */
  $exporter = \Drupal::service('default_content.exporter');
  $export = $exporter
    ->exportContent($entity_type_id, $entity_id, drush_get_option('file'));
  if (!drush_get_option('file')) {
    drush_print($export);
  }
}