class TestMigrateExecutable
Tests MigrateExecutable.
Hierarchy
- class \Drupal\migrate\MigrateExecutable implements \Drupal\migrate\MigrateExecutableInterface uses \Drupal\Core\StringTranslation\StringTranslationTrait
- class \Drupal\Tests\migrate\Unit\TestMigrateExecutable extends \Drupal\migrate\MigrateExecutable
Expanded class hierarchy of TestMigrateExecutable
File
-
core/
modules/ migrate/ tests/ src/ Unit/ TestMigrateExecutable.php, line 13
Namespace
Drupal\Tests\migrate\UnitView source
class TestMigrateExecutable extends MigrateExecutable {
/**
* Sets the string translation service.
*
* @param \Drupal\Core\StringTranslation\TranslationInterface $string_translation
* The translation manager.
*/
public function setStringTranslation(TranslationInterface $string_translation) {
$this->stringTranslation = $string_translation;
return $this;
}
/**
* Allows access to set protected source property.
*
* @param \Drupal\migrate\Plugin\MigrateSourceInterface $source
* The value to set.
*/
public function setSource($source) {
$this->source = $source;
}
/**
* Allows access to protected sourceIdValues property.
*
* @param array $source_id_values
* The values to set.
*/
public function setSourceIdValues($source_id_values) {
$this->sourceIdValues = $source_id_values;
}
/**
* {@inheritdoc}
*/
public function handleException(\Exception $exception, $save = TRUE) {
$message = $exception->getMessage();
if ($save) {
$this->saveMessage($message);
}
$this->message
->display($message);
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title | Overrides |
|---|---|---|---|---|---|
| MigrateExecutable::$counts | protected | property | An array of counts. Initially used for cache hit/miss tracking. | ||
| MigrateExecutable::$eventDispatcher | protected | property | The event dispatcher. | ||
| MigrateExecutable::$message | public | property | Migration message service. | ||
| MigrateExecutable::$migration | protected | property | The configuration of the migration to do. | ||
| MigrateExecutable::$source | protected | property | The source. | ||
| MigrateExecutable::$sourceIdValues | protected | property | The configuration values of the source. | 1 | |
| MigrateExecutable::$sourceRowStatus | protected | property | Status of one row. | ||
| MigrateExecutable::currentSourceIds | protected | function | Fetches the key array for the current source record. | ||
| MigrateExecutable::getEventDispatcher | protected | function | Gets the event dispatcher. | ||
| MigrateExecutable::getIdMap | protected | function | Get the ID map from the current migration. | 2 | |
| MigrateExecutable::getSource | protected | function | Returns the source. | 1 | |
| MigrateExecutable::import | public | function | Performs an import operation - migrate items from source to destination. | Overrides MigrateExecutableInterface::import | |
| MigrateExecutable::processPipeline | protected | function | Runs a process pipeline. | ||
| MigrateExecutable::processRow | public | function | Processes a row. | Overrides MigrateExecutableInterface::processRow | |
| MigrateExecutable::rollback | public | function | Performs a rollback operation - remove previously-imported items. | Overrides MigrateExecutableInterface::rollback | |
| MigrateExecutable::saveMessage | public | function | Passes messages through to the map class. | Overrides MigrateExecutableInterface::saveMessage | |
| MigrateExecutable::__construct | public | function | Constructs a MigrateExecutable. | ||
| StringTranslationTrait::$stringTranslation | protected | property | The string translation service. | 3 | |
| StringTranslationTrait::formatPlural | protected | function | Formats a string containing a count of items. | ||
| StringTranslationTrait::getNumberOfPlurals | protected | function | Returns the number of plurals supported by a given language. | ||
| StringTranslationTrait::getStringTranslation | protected | function | Gets the string translation service. | ||
| StringTranslationTrait::t | protected | function | Translates a string to the current language or to a given language. | 1 | |
| TestMigrateExecutable::handleException | public | function | Takes an Exception object and both saves and displays it. | Overrides MigrateExecutable::handleException | |
| TestMigrateExecutable::setSource | public | function | Allows access to set protected source property. | ||
| TestMigrateExecutable::setSourceIdValues | public | function | Allows access to protected sourceIdValues property. | ||
| TestMigrateExecutable::setStringTranslation | public | function | Sets the string translation service. | Overrides StringTranslationTrait::setStringTranslation |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.