You are here

public function Dom::__construct in Migrate Plus 8.5

Same name and namespace in other branches
  1. 8.4 src/Plugin/migrate/process/Dom.php \Drupal\migrate_plus\Plugin\migrate\process\Dom::__construct()

Constructs a \Drupal\Component\Plugin\PluginBase object.

Parameters

array $configuration: A configuration array containing information about the plugin instance.

string $plugin_id: The plugin_id for the plugin instance.

mixed $plugin_definition: The plugin implementation definition.

Overrides PluginBase::__construct

File

src/Plugin/migrate/process/Dom.php, line 93

Class

Dom
Handles string to DOM and back conversions.

Namespace

Drupal\migrate_plus\Plugin\migrate\process

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition) {
  if (!isset($configuration['method'])) {
    throw new \InvalidArgumentException('The "method" must be set.');
  }
  if (!in_array($configuration['method'], [
    'import',
    'export',
  ])) {
    throw new \InvalidArgumentException('The "method" must be "import" or "export".');
  }
  parent::__construct($configuration, $plugin_id, $plugin_definition);
  $this->configuration += $this
    ->defaultValues();
  $this->logMessages = (bool) $this->configuration['log_messages'];
  $this->nonRoot = (bool) $this->configuration['non_root'];
}