MigrateExecutable
class MigrateExecutable implements MigrateExecutableInterface (View source)
Defines a migrate executable class.
Traits
Wrapper methods for \Drupal\Core\StringTranslation\TranslationInterface.
Properties
| protected TranslationInterface | $stringTranslation | The string translation service. |
from StringTranslationTrait |
| protected MigrationInterface | $migration | The configuration of the migration to do. |
|
| protected int | $sourceRowStatus | Status of one row. |
|
| protected float | $memoryThreshold | The ratio of the memory limit at which an operation will be interrupted. |
|
| protected int | $memoryLimit | The PHP memory_limit expressed in bytes. |
|
| protected array | $sourceIdValues | The configuration values of the source. |
|
| protected array | $counts | An array of counts. Initially used for cache hit/miss tracking. |
|
| protected MigrateSourceInterface | $source | The source. |
|
| protected EventDispatcherInterface | $eventDispatcher | The event dispatcher. |
|
| MigrateMessageInterface | $message | Migration message service. |
Methods
Translates a string to the current language or to a given language.
Formats a string containing a count of items.
Returns the number of plurals supported by a given language.
Gets the string translation service.
Constructs a MigrateExecutable and verifies and sets the memory limit.
Returns the source.
Gets the event dispatcher.
Performs an import operation - migrate items from source to destination.
Performs a rollback operation - remove previously-imported items.
Get the ID map from the current migration.
Fetches the key array for the current source record.
Passes messages through to the map class.
Takes an Exception object and both saves and displays it.
Checks for exceptional conditions, and display feedback.
Tests whether we've exceeded the desired memory threshold.
Returns the memory usage so far.
Tries to reclaim memory.
Generates a string representation for the given byte count.
Details
protected TranslatableMarkup
t(string $string, array $args = [], array $options = [])
Translates a string to the current language or to a given language.
See \Drupal\Core\StringTranslation\TranslatableMarkup::__construct() for important security information and usage guidelines.
In order for strings to be localized, make them available in one of the ways supported by the
protected
formatPlural($count, $singular, $plural, array $args = [], array $options = [])
Formats a string containing a count of items.
protected
getNumberOfPlurals($langcode = NULL)
Returns the number of plurals supported by a given language.
protected TranslationInterface
getStringTranslation()
Gets the string translation service.
$this
setStringTranslation(TranslationInterface $translation)
Sets the string translation service to use.
__construct(MigrationInterface $migration, MigrateMessageInterface $message = NULL, EventDispatcherInterface $event_dispatcher = NULL)
Constructs a MigrateExecutable and verifies and sets the memory limit.
protected MigrateSourceInterface
getSource()
Returns the source.
Makes sure source is initialized based on migration settings.
protected EventDispatcherInterface
getEventDispatcher()
Gets the event dispatcher.
import()
Performs an import operation - migrate items from source to destination.
rollback()
Performs a rollback operation - remove previously-imported items.
protected MigrateIdMapInterface
getIdMap()
Get the ID map from the current migration.
processRow(Row $row, array $process = NULL, mixed $value = NULL)
Processes a row.
protected array
currentSourceIds()
Fetches the key array for the current source record.
saveMessage(string $message, int $level = MigrationInterface::MESSAGE_ERROR)
Passes messages through to the map class.
protected
handleException(Exception $exception, bool $save = TRUE)
Takes an Exception object and both saves and displays it.
Pulls in additional information on the location triggering the exception.
protected
checkStatus()
Checks for exceptional conditions, and display feedback.
protected bool
memoryExceeded()
Tests whether we've exceeded the desired memory threshold.
If so, output a message.
protected int
getMemoryUsage()
Returns the memory usage so far.
protected int
attemptMemoryReclaim()
Tries to reclaim memory.
protected string
formatSize(int $size)
Generates a string representation for the given byte count.