interface MigrationInterface implements PluginInspectionInterface, DerivativeInspectionInterface (View source)

Interface for migrations.

Constants

STATUS_IDLE

The migration is currently not running.

STATUS_IMPORTING

The migration is currently importing.

STATUS_ROLLING_BACK

The migration is currently being rolled back.

STATUS_STOPPING

The migration is being stopped.

STATUS_DISABLED

The migration has been disabled.

MESSAGE_ERROR

Migration error.

MESSAGE_WARNING

Migration warning.

MESSAGE_NOTICE

Migration notice.

MESSAGE_INFORMATIONAL

Migration info.

RESULT_COMPLETED

All records have been processed.

RESULT_INCOMPLETE

The process has stopped itself (e.g., the memory limit is approaching).

RESULT_STOPPED

The process was stopped externally (e.g., via drush migrate-stop).

RESULT_FAILED

The process had a fatal error.

RESULT_SKIPPED

Dependencies are unfulfilled - skip the process.

RESULT_DISABLED

This migration is disabled, skipping.

Methods

string
getPluginId()

Gets the plugin_id of the plugin instance.

array
getPluginDefinition()

Gets the definition of the plugin implementation.

string
getBaseId()

Gets the base_plugin_id of the plugin instance.

string|null
getDerivativeId()

Gets the derivative_id of the plugin instance.

string
id()

An alias for getPluginId() for backwards compatibility reasons.

string
label()

Get the plugin label.

getSourcePlugin()

Returns the initialized source plugin.

MigrateProcessInterface[][]
getProcessPlugins(array $process = NULL)

Returns the process plugins.

getDestinationPlugin(bool $stub_being_requested = FALSE)

Returns the initialized destination plugin.

getIdMap()

Returns the initialized id_map plugin.

bool
allRowsProcessed()

Check if all source rows from this migration have been processed.

setStatus(int $status)

Set the current migration status.

int
getStatus()

Get the current migration status.

string
getStatusLabel()

Retrieve a label for the current status.

int
getInterruptionResult()

Get the result to return upon interruption.

clearInterruptionResult()

Clears the result to return upon interruption.

interruptMigration(int $result)

Signal that the migration should be interrupted with the specified result code.

array
getProcess()

Get the normalized process pipeline configuration describing the process plugins.

$this
setProcess(array $process)

Allows you to override the entire process configuration.

$this
setProcessOfProperty(string $property, mixed $process_of_property)

Set the process pipeline configuration for an individual destination field.

$this
mergeProcessOfProperty(string $property, array $process_of_property)

Merge the process pipeline configuration for a single property.

bool
isTrackLastImported()

Checks if the migration should track time of last import.

$this
setTrackLastImported(bool $track_last_imported)

Set if the migration should track time of last import.

array
getMigrationDependencies()

Get the dependencies for this migration.

array
getDestinationConfiguration()

Get the destination configuration, with at least a 'plugin' key.

array
getSourceConfiguration()

Get the source configuration, with at least a 'plugin' key.

bool
getTrackLastImported()

If true, track time of last import.

array
getDestinationIds()

The destination identifiers.

array
getMigrationTags()

The migration tags.

bool
isAuditable()

Indicates if the migration is auditable.

Details

string getPluginId()

Gets the plugin_id of the plugin instance.

Return Value

string

The plugin_id of the plugin instance.

array getPluginDefinition()

Gets the definition of the plugin implementation.

Return Value

array

The plugin definition, as returned by the discovery object used by the plugin manager.

string getBaseId()

Gets the base_plugin_id of the plugin instance.

Return Value

string

The base_plugin_id of the plugin instance.

string|null getDerivativeId()

Gets the derivative_id of the plugin instance.

Return Value

string|null

The derivative_id of the plugin instance NULL otherwise.

string id()

An alias for getPluginId() for backwards compatibility reasons.

Return Value

string

The plugin_id of the plugin instance.

See also

\Drupal\migrate\Plugin\MigrationInterface::getPluginId()

string label()

Get the plugin label.

Return Value

string

The label for this migration.

MigrateSourceInterface getSourcePlugin()

Returns the initialized source plugin.

Return Value

MigrateSourceInterface

The source plugin.

MigrateProcessInterface[][] getProcessPlugins(array $process = NULL)

Returns the process plugins.

Parameters

array $process

A process configuration array.

Return Value

MigrateProcessInterface[][]

An associative array. The keys are the destination property names. Values are process pipelines. Each pipeline contains an array of plugins.

MigrateDestinationInterface getDestinationPlugin(bool $stub_being_requested = FALSE)

Returns the initialized destination plugin.

Parameters

bool $stub_being_requested

TRUE to indicate that this destination will be asked to construct a stub.

Return Value

MigrateDestinationInterface

The destination plugin.

MigrateIdMapInterface getIdMap()

Returns the initialized id_map plugin.

Return Value

MigrateIdMapInterface

The ID map.

bool allRowsProcessed()

Check if all source rows from this migration have been processed.

Return Value

bool

TRUE if this migration is complete otherwise FALSE.

setStatus(int $status)

Set the current migration status.

Parameters

int $status

One of the STATUS_* constants.

int getStatus()

Get the current migration status.

Return Value

int

The current migration status. Defaults to STATUS_IDLE.

string getStatusLabel()

Retrieve a label for the current status.

Return Value

string

User-friendly string corresponding to a STATUS_ constant.

int getInterruptionResult()

Get the result to return upon interruption.

Return Value

int

The current interruption result. Defaults to RESULT_INCOMPLETE.

clearInterruptionResult()

Clears the result to return upon interruption.

interruptMigration(int $result)

Signal that the migration should be interrupted with the specified result code.

Parameters

int $result

One of the MigrationInterface::RESULT_* constants.

array getProcess()

Get the normalized process pipeline configuration describing the process plugins.

The process configuration is always normalized. All shorthand processing will be expanded into their full representations.

Return Value

array

The normalized configuration describing the process plugins.

See also

https://www.drupal.org/node/2129651#get-shorthand

$this setProcess(array $process)

Allows you to override the entire process configuration.

Parameters

array $process

The entire process pipeline configuration describing the process plugins.

Return Value

$this

$this setProcessOfProperty(string $property, mixed $process_of_property)

Set the process pipeline configuration for an individual destination field.

This method allows you to set the process pipeline configuration for a single property within the full process pipeline configuration.

Parameters

string $property

The property of which to set the process pipeline configuration.

mixed $process_of_property

The process pipeline configuration to be set for this property.

Return Value

$this

The migration entity.

$this mergeProcessOfProperty(string $property, array $process_of_property)

Merge the process pipeline configuration for a single property.

Parameters

string $property

The property of which to merge the passed in process pipeline configuration.

array $process_of_property

The process pipeline configuration to be merged with the existing process pipeline configuration.

Return Value

$this

The migration entity.

See also

\Drupal\migrate\Plugin\Drupal\migrate_drupal\Plugin\migrate\load\LoadEntity::processLinkField()

bool isTrackLastImported()

Checks if the migration should track time of last import.

Return Value

bool

TRUE if the migration is tracking last import time.

$this setTrackLastImported(bool $track_last_imported)

Set if the migration should track time of last import.

Parameters

bool $track_last_imported

Boolean value to indicate if the migration should track last import time.

Return Value

$this

array getMigrationDependencies()

Get the dependencies for this migration.

Return Value

array

The dependencies for this migrations.

array getDestinationConfiguration()

Get the destination configuration, with at least a 'plugin' key.

Return Value

array

The destination configuration.

array getSourceConfiguration()

Get the source configuration, with at least a 'plugin' key.

Return Value

array

The source configuration.

bool getTrackLastImported()

If true, track time of last import.

Return Value

bool

Flag to determine desire of tracking time of last import.

array getDestinationIds()

The destination identifiers.

An array of destination identifiers: the keys are the name of the properties, the values are dependent on the ID map plugin.

Return Value

array

Destination identifiers.

array getMigrationTags()

The migration tags.

Return Value

array

Migration tags.

bool isAuditable()

Indicates if the migration is auditable.

Return Value

bool