You are here

public function YamlContentCommands::contentImport in YAML Content 8

Import yaml content.

@command yaml_content:import @option create-new Set this to create content even if it is already in the system. @aliases yci,yaml-content-import

Parameters

string $directory: The directory path where content files may be found.

string $file: (Optional) The name of a content file to be imported.

array $options: An associative array of options whose values come from cli, aliases, config, etc.

File

src/Commands/YamlContentCommands.php, line 65

Class

YamlContentCommands
YAML Content commands class for Drush 9.0.0-beta5 and above.

Namespace

Drupal\yaml_content\Commands

Code

public function contentImport($directory, $file = NULL, array $options = [
  'create-new' => NULL,
]) {
  $this->loader
    ->importDirectory($directory, $file);
}