trait MigrationConfigurationTrait (View source)

Configures the appropriate migrations for a given source Drupal database.

Properties

protected ConfigFactoryInterface $configFactory

The config factory service.

protected MigrationPluginManagerInterface $migrationPluginManager

The migration plugin manager service.

protected StateInterface $state

The state service.

protected string[] $followUpMigrationTags

The follow-up migration tags.

Methods

getConnection(array $database)

Gets the database connection for the source Drupal database.

array
getSystemData(Connection $connection)

Gets the system data from the system table of the source Drupal database.

createDatabaseStateSettings(array $database, string $drupal_version)

Creates the necessary state entries for SqlBase::getDatabase() to work.

getMigrations(string $database_state_key, int $drupal_version)

Gets the migrations for import.

string[]
getFollowUpMigrationTags()

Returns the follow-up migration tags.

static string|false
getLegacyDrupalVersion(Connection $connection)

Determines what version of Drupal the source database contains.

getConfigFactory()

Gets the config factory service.

getMigrationPluginManager()

Gets the migration plugin manager service.

getState()

Gets the state service.

Details

protected Connection getConnection(array $database)

Gets the database connection for the source Drupal database.

Parameters

array $database

Database array representing the source Drupal database.

Return Value

Connection

The database connection for the source Drupal database.

protected array getSystemData(Connection $connection)

Gets the system data from the system table of the source Drupal database.

Parameters

Connection $connection

Database connection to the source Drupal database.

Return Value

array

The system data from the system table of the source Drupal database.

protected createDatabaseStateSettings(array $database, string $drupal_version)

Creates the necessary state entries for SqlBase::getDatabase() to work.

The state entities created here have to exist before migration plugin instances are created so that derivers such as \Drupal\taxonomy\Plugin\migrate\D6TermNodeDeriver can access the source database.

Parameters

array $database

The source database settings.

string $drupal_version

The Drupal version.

See also

SqlBase::getDatabase

protected MigrationInterface[] getMigrations(string $database_state_key, int $drupal_version)

Gets the migrations for import.

Parameters

string $database_state_key

The state key.

int $drupal_version

The version of Drupal we're getting the migrations for.

Return Value

MigrationInterface[]

The migrations for import.

protected string[] getFollowUpMigrationTags()

Returns the follow-up migration tags.

Return Value

string[]

static string|false getLegacyDrupalVersion(Connection $connection)

Determines what version of Drupal the source database contains.

Parameters

Connection $connection

The database connection object.

Return Value

string|false

A string representing the major branch of Drupal core (e.g. '6' for Drupal 6.x), or FALSE if no valid version is matched.

protected ConfigFactoryInterface getConfigFactory()

Gets the config factory service.

Return Value

ConfigFactoryInterface

The config factory service.

protected MigrationPluginManagerInterface getMigrationPluginManager()

Gets the migration plugin manager service.

Return Value

MigrationPluginManagerInterface

The migration plugin manager service.

protected StateInterface getState()

Gets the state service.

Return Value

StateInterface

The state service.