trait MigrateRunnerTrait (View source)

Properties

protected MigrationPluginManagerInterface|null $migrationPluginManager
protected KeyValueStoreInterface $keyValue

Methods

setMigrationPluginManager(MigrationPluginManagerInterface $migrationPluginManager)

Provide a migration plugin manager.

int|null
getMigrationSourceRowsCount(MigrationInterface $migration)

Returns the migration source rows count.

int
getMigrationNeedingUpdateCount(MigrationInterface $migration)

Returns the number of items that needs update.

int|null
getMigrationUnprocessedCount(MigrationInterface $migration)

Returns the number of unprocessed items.

int|null
getMigrationImportedCount(MigrationInterface $migration)

Returns the number of imported items.

string
getMigrationLastImportedTime(MigrationInterface $migration, DateFormatterInterface $dateFormatter)

Returns the last imported date/time if any.

array
padTableRow(array $row, array $fields)

Pads an incomplete table row with empty cells.

array
getMigrationList(string|null $migrationIds, string|null $tags)

Retrieves a list of active migrations.

MigrateMessageInterface
getMigrateMessage()

Returns the migrate message logger.

array
getSourceIdKeys(MigrateIdMapInterface $idMap)

Get the source ID keys.

array
preprocessMessageRow(StdClass $row, array $sourceIdKeys)

Preprocesses migrate message rows.

Details

setMigrationPluginManager(MigrationPluginManagerInterface $migrationPluginManager)

Provide a migration plugin manager.

Parameters

MigrationPluginManagerInterface $migrationPluginManager

protected int|null getMigrationSourceRowsCount(MigrationInterface $migration)

Returns the migration source rows count.

Parameters

MigrationInterface $migration

The migration plugin instance.

Return Value

int|null

The migration source rows count or null if the source is uncountable or the source count couldn't be retrieved.

protected int getMigrationNeedingUpdateCount(MigrationInterface $migration)

Returns the number of items that needs update.

Parameters

MigrationInterface $migration

The migration plugin instance.

Return Value

int

The number of items that needs update.

protected int|null getMigrationUnprocessedCount(MigrationInterface $migration)

Returns the number of unprocessed items.

Parameters

MigrationInterface $migration

The migration plugin instance.

Return Value

int|null

The number of unprocessed items or null if it cannot be determined.

protected int|null getMigrationImportedCount(MigrationInterface $migration)

Returns the number of imported items.

Parameters

MigrationInterface $migration

The migration plugin instance.

Return Value

int|null

The number of imported items or null if it cannot be determined.

protected string getMigrationLastImportedTime(MigrationInterface $migration, DateFormatterInterface $dateFormatter)

Returns the last imported date/time if any.

Parameters

MigrationInterface $migration

The migration plugin instance.

DateFormatterInterface $dateFormatter

Return Value

string

The last imported date/time if any.

protected array padTableRow(array $row, array $fields)

Pads an incomplete table row with empty cells.

Parameters

array $row

The row to be prepared.

array $fields

The table columns.

Return Value

array

The complete table row.

protected array getMigrationList(string|null $migrationIds, string|null $tags)

Retrieves a list of active migrations.

Parameters

string|null $migrationIds

A comma-separated list of migration IDs. If omitted, will return all migrations.

string|null $tags

A comma separated list of tags.

Return Value

array

An array keyed by migration tag, each value containing an array of migrations or an empty array if no migrations match the input criteria.

Exceptions

PluginException

protected MigrateMessageInterface getMigrateMessage()

Returns the migrate message logger.

Return Value

MigrateMessageInterface

The migrate message logger.

protected array getSourceIdKeys(MigrateIdMapInterface $idMap)

Get the source ID keys.

Parameters

MigrateIdMapInterface $idMap

The migration ID map.

Return Value

array

The source ID keys.

protected array preprocessMessageRow(StdClass $row, array $sourceIdKeys)

Preprocesses migrate message rows.

Given an item inside the list generated by MigrateIdMapInterface::getMessages(), prepare it for display.

Parameters

StdClass $row

A message to process.

array $sourceIdKeys

The source IDs keys, for reference.

Return Value

array

See also

\Drupal\migrate\Plugin\MigrateIdMapInterface::getMessages()