function Variable::__construct

Same name in other branches
  1. 8.9.x core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php \Drupal\migrate_drupal\Plugin\migrate\source\Variable::__construct()
  2. 10 core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php \Drupal\migrate_drupal\Plugin\migrate\source\Variable::__construct()
  3. 11.x core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php \Drupal\migrate_drupal\Plugin\migrate\source\Variable::__construct()

Overrides DrupalSqlBase::__construct

File

core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php, line 102

Class

Variable
Drupal 6/7 variable source from database.

Namespace

Drupal\migrate_drupal\Plugin\migrate\source

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, StateInterface $state, EntityTypeManagerInterface $entity_type_manager) {
    parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $state, $entity_type_manager);
    $this->variablesNoRowIfMissing = $this->configuration['variables_no_row_if_missing'] ?? [];
    $variables = $this->configuration['variables'] ?? [];
    $this->variables = array_unique(array_merge(array_values($variables), array_values($this->variablesNoRowIfMissing)));
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.