Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Sql.php

function Sql::__construct

Same name in this branch
  1. 11.1.x core/modules/views/src/Plugin/views/query/Sql.php \Drupal\views\Plugin\views\query\Sql::__construct()

Constructs an SQL object.

Sets up the tables and builds the maps,

Parameters

array $configuration: The configuration.

string $plugin_id: The plugin ID for the migration process to do.

mixed $plugin_definition: The configuration for the plugin.

\Drupal\migrate\Plugin\MigrationInterface $migration: The migration to do.

\Symfony\Contracts\EventDispatcher\EventDispatcherInterface $event_dispatcher: The event dispatcher.

\Drupal\migrate\Plugin\MigrationPluginManagerInterface $migration_plugin_manager: The migration plugin manager.

File

core/modules/migrate/src/Plugin/migrate/id_map/Sql.php, line 173

Class

Sql
Defines the sql based ID map implementation.

Namespace

Drupal\migrate\Plugin\migrate\id_map

Code

public function __construct(array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EventDispatcherInterface $event_dispatcher, ?MigrationPluginManagerInterface $migration_plugin_manager = NULL) {
    parent::__construct($configuration, $plugin_id, $plugin_definition);
    $this->migration = $migration;
    $this->eventDispatcher = $event_dispatcher;
    $this->message = new MigrateMessage();
    if (!isset($this->database)) {
        $this->database = \Drupal::database();
    }
    // Default generated table names, limited to 63 characters.
    $machine_name = str_replace(':', '__', $this->migration
        ->id());
    $prefix_length = strlen($this->database
        ->getPrefix());
    $this->mapTableName = 'migrate_map_' . mb_strtolower($machine_name);
    $this->mapTableName = mb_substr($this->mapTableName, 0, 63 - $prefix_length);
    $this->messageTableName = 'migrate_message_' . mb_strtolower($machine_name);
    $this->messageTableName = mb_substr($this->messageTableName, 0, 63 - $prefix_length);
    $this->migrationPluginManager = $migration_plugin_manager;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal