class TestSqlIdMap in Zircon Profile 8
Same name and namespace in other branches
- 8.0 core/modules/migrate/tests/src/Unit/TestSqlIdMap.php \Drupal\Tests\migrate\Unit\TestSqlIdMap
Defines a SQL ID map for use in tests.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, StringTranslationTrait
- class \Drupal\migrate\Plugin\migrate\id_map\Sql implements ContainerFactoryPluginInterface, MigrateIdMapInterface
- class \Drupal\Tests\migrate\Unit\TestSqlIdMap implements \Drupal\Tests\migrate\Unit\Iterator
- class \Drupal\migrate\Plugin\migrate\id_map\Sql implements ContainerFactoryPluginInterface, MigrateIdMapInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, StringTranslationTrait
Expanded class hierarchy of TestSqlIdMap
File
- core/
modules/ migrate/ tests/ src/ Unit/ TestSqlIdMap.php, line 19 - Contains \Drupal\Tests\migrate\Unit\TestSqlIdMap.
Namespace
Drupal\Tests\migrate\UnitView source
class TestSqlIdMap extends Sql implements \Iterator {
/**
* Constructs a TestSqlIdMap object.
*
* @param \Drupal\Core\Database\Connection $database
* The database.
* @param array $configuration
* The configuration.
* @param string $plugin_id
* The plugin ID for the migration process to do.
* @param mixed $plugin_definition
* The configuration for the plugin.
* @param \Drupal\migrate\Entity\MigrationInterface $migration
* The migration to do.
*/
public function __construct(Connection $database, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration, EventDispatcherInterface $event_dispatcher) {
$this->database = $database;
parent::__construct($configuration, $plugin_id, $plugin_definition, $migration, $event_dispatcher);
}
/**
* {@inheritdoc}
*/
public function getDatabase() {
return parent::getDatabase();
}
protected function getFieldSchema(array $id_definition) {
if (!isset($id_definition['type'])) {
return array();
}
switch ($id_definition['type']) {
case 'integer':
return array(
'type' => 'int',
'not null' => TRUE,
);
case 'string':
return array(
'type' => 'varchar',
'length' => 255,
'not null' => FALSE,
);
default:
throw new MigrateException($id_definition['type'] . ' not supported');
}
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
MigrateIdMapInterface:: |
constant | Codes reflecting how to handle the destination item on rollback. | ||
MigrateIdMapInterface:: |
constant | |||
MigrateIdMapInterface:: |
constant | |||
MigrateIdMapInterface:: |
constant | |||
MigrateIdMapInterface:: |
constant | Codes reflecting the current status of a map row. | ||
MigrateIdMapInterface:: |
constant | |||
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 2 |
PluginBase:: |
protected | property | The plugin implementation definition. | |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
Sql:: |
protected | property | The current key. | |
Sql:: |
protected | property | The current row. | |
Sql:: |
protected | property | The database connection for the map/message tables on the destination. | |
Sql:: |
protected | property | The destination ID fields. | |
Sql:: |
protected | property | The destination identifiers. | |
Sql:: |
protected | property | An event dispatcher instance to use for map events. | |
Sql:: |
protected | property | Whether the plugin is already initialized. | |
Sql:: |
protected | property | The migration map table name. | |
Sql:: |
protected | property | The migrate message. | |
Sql:: |
protected | property | The message table name. | |
Sql:: |
protected | property | The migration being done. | |
Sql:: |
protected | property | ||
Sql:: |
protected | property | The result. | |
Sql:: |
protected | property | The source ID fields. | |
Sql:: |
protected | property | The source identifiers. | |
Sql:: |
public | function |
Clears all messages from the map. Overrides MigrateIdMapInterface:: |
|
Sql:: |
protected | function | Counts records in a table. | |
Sql:: |
public static | function |
Creates an instance of the plugin. Overrides ContainerFactoryPluginInterface:: |
|
Sql:: |
public | function | Implementation of Iterator::current(). | |
Sql:: |
public | function |
@inheritdoc Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function |
Deletes the map and message entries for a given source record. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function |
Deletes the map and message table entries for a given destination row. Overrides MigrateIdMapInterface:: |
|
Sql:: |
protected | function | The destination ID fields. | |
Sql:: |
public | function |
Removes any persistent storage used by this map. Overrides MigrateIdMapInterface:: |
|
Sql:: |
protected | function | Create the map and message tables if they don't already exist. | |
Sql:: |
public | function |
Returns the number of items that failed to import. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function |
Retrieves an iterator over messages relate to source records. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function |
Get the fully qualified map table name. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function |
Retrieves a row by the destination identifiers. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function |
Retrieves a row from the map table based on source identifier values. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function |
Retrieves an array of map rows marked as needing update. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function |
Returns the number of imported items in the map. Overrides MigrateIdMapInterface:: |
|
Sql:: |
protected | function | Initialize the plugin. | |
Sql:: |
public | function | Implementation of Iterator::key(). | |
Sql:: |
public | function |
Looks up the destination identifier corresponding to a source key. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function |
Looks up the source identifier. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function | The name of the database map table. | |
Sql:: |
public | function |
Returns the number of messages saved. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function | The name of the database message table. | |
Sql:: |
public | function | Implementation of Iterator::next(). | |
Sql:: |
public | function |
Prepares to run a full update. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function |
Returns the number of processed items in the map. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function | Implementation of Iterator::rewind(). | |
Sql:: |
public | function |
Saves a mapping from the source identifiers to the destination identifiers. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function |
Saves a message related to a source record in the migration message table. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function |
Sets the migrate message. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function |
Sets a specified record to be updated, if it exists. Overrides MigrateIdMapInterface:: |
|
Sql:: |
protected | function | The source ID fields. | |
Sql:: |
public | function |
Returns a count of items which are marked as needing update. Overrides MigrateIdMapInterface:: |
|
Sql:: |
public | function | Implementation of Iterator::valid(). | |
StringTranslationTrait:: |
protected | property | The string translation service. | |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
TestSqlIdMap:: |
public | function |
Gets the database connection. Overrides Sql:: |
|
TestSqlIdMap:: |
protected | function |
Creates schema from an ID definition. Overrides Sql:: |
|
TestSqlIdMap:: |
public | function |
Constructs a TestSqlIdMap object. Overrides Sql:: |