final class NodeMigrateType (View source)

Provides a class to determine the type of migration.

Traits

Configures the appropriate migrations for a given source Drupal database.

Constants

NODE_MIGRATE_TYPE_COMPLETE

Only the complete node migration map tables are in use.

NODE_MIGRATE_TYPE_CLASSIC

Only the classic node migration map tables are in use.

Properties

protected ConfigFactoryInterface $configFactory

The config factory service.

from  MigrationConfigurationTrait
protected MigrationPluginManagerInterface $migrationPluginManager

The migration plugin manager service.

from  MigrationConfigurationTrait
protected StateInterface $state

The state service.

from  MigrationConfigurationTrait
protected string[] $followUpMigrationTags

The follow-up migration tags.

from  MigrationConfigurationTrait

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.

getState()

Gets the state service.

static string
getNodeMigrateType(Connection $connection, string|false $version)

Determines the type of node migration to be used.

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.

static string getNodeMigrateType(Connection $connection, string|false $version)

internal  
 

Determines the type of node migration to be used.

The node complete migration is the default. It is not used when there are existing tables for dN_node.

Parameters

Connection $connection

The connection to the target database.

string|false $version

The Drupal version of the source database, FALSE if it cannot be determined.

Return Value

string

The migrate type.