You are here

public function Table::__construct in Migrate Plus 8.5

Same name in this branch
  1. 8.5 src/Plugin/migrate/source/Table.php \Drupal\migrate_plus\Plugin\migrate\source\Table::__construct()
  2. 8.5 src/Plugin/migrate/destination/Table.php \Drupal\migrate_plus\Plugin\migrate\destination\Table::__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 SqlBase::__construct

File

src/Plugin/migrate/source/Table.php, line 45

Class

Table
Source plugin for retrieving data via URLs.

Namespace

Drupal\migrate_plus\Plugin\migrate\source

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, StateInterface $state) {
  parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $state);
  $this->tableName = $configuration['table_name'];

  // Insert alias in id_fields.
  foreach ($configuration['id_fields'] as &$field) {
    $field['alias'] = static::TABLE_ALIAS;
  }
  $this->idFields = $configuration['id_fields'];
  $this->fields = isset($configuration['fields']) ? $configuration['fields'] : [];
}