You are here

function drush_yaml_content_import_module in YAML Content 8

Same name and namespace in other branches
  1. 8.2 yaml_content.drush.inc \drush_yaml_content_import_module()

Import specified yaml content file(s) from a designated module.

Parameters

string $module: The module to look for content files within.

This command assumes files will be contained within a `content/` directory at the top of the module's main directory. Any files within matching the pattern `*.content.yml` will then be imported.

string|string[] $file: (Optional) The name of a file to be imported or an array of files to import. If this argument is not provided then all files in the directory matching `*.content.yml` are queued for import.

See also

\Drupal\yaml_content\Service\LoadHelper::importModule()

File

./yaml_content.drush.inc, line 88
Drush commands for the yaml_content module.

Code

function drush_yaml_content_import_module($module, $file = NULL) {
  $load_helper = \Drupal::service('yaml_content.load_helper');
  $load_helper
    ->importModule($module, $file);
}