diff --git a/core/modules/migrate/lib/Drupal/migrate/Entity/Migration.php b/core/modules/migrate/lib/Drupal/migrate/Entity/Migration.php index 75c2cc6..3b7b300 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Entity/Migration.php +++ b/core/modules/migrate/lib/Drupal/migrate/Entity/Migration.php @@ -313,7 +313,7 @@ public function checkRequirements() { } /** @var \Drupal\migrate\Entity\MigrationInterface[] $required_migrations */ - $required_migrations = entity_load_multiple('migration', $this->requirements); + $required_migrations = \Drupal::entityManager()->getStorageController('migration')->loadMultiple($this->requirements); // Check if the dependencies are in good shape. foreach ($required_migrations as $required_migration) { // If the dependent source migration has no IDs then no mappings can diff --git a/core/modules/migrate/lib/Drupal/migrate/Entity/MigrationInterface.php b/core/modules/migrate/lib/Drupal/migrate/Entity/MigrationInterface.php index 732291f..141bdf1 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Entity/MigrationInterface.php +++ b/core/modules/migrate/lib/Drupal/migrate/Entity/MigrationInterface.php @@ -86,14 +86,19 @@ public function getIdMap(); /** * The current value of the highwater mark. * + * The highwater mark defines a timestamp stating the time the import was last + * run. If the mark is set, only content with a higher timestamp will be + * imported. + * * @return int */ public function getHighwater(); /** - * Save the highwater mark. + * Save the new highwater mark. * - * @return int + * @param int $highwater + * The highwater timestamp. */ public function saveHighwater($highwater); diff --git a/core/modules/migrate/lib/Drupal/migrate/MigrateExecutable.php b/core/modules/migrate/lib/Drupal/migrate/MigrateExecutable.php index 73974d7..689af20 100644 --- a/core/modules/migrate/lib/Drupal/migrate/MigrateExecutable.php +++ b/core/modules/migrate/lib/Drupal/migrate/MigrateExecutable.php @@ -88,9 +88,6 @@ class MigrateExecutable { /** * The ratio of the memory limit at which an operation will be interrupted. * - * Can be overridden by a Migration subclass if one would like to push the - * envelope. Defaults to 0.85. - * * @var float */ protected $memoryThreshold = 0.85; @@ -98,9 +95,6 @@ class MigrateExecutable { /** * The ratio of the time limit at which an operation will be interrupted. * - * Can be overridden by a Migration subclass if one would like to push the - * envelope. Defaults to 0.9. - * * @var float */ public $timeThreshold = 0.90; diff --git a/core/modules/migrate/lib/Drupal/migrate/MigrationStorageController.php b/core/modules/migrate/lib/Drupal/migrate/MigrationStorageController.php index 1fd07f7..1cd8561 100644 --- a/core/modules/migrate/lib/Drupal/migrate/MigrationStorageController.php +++ b/core/modules/migrate/lib/Drupal/migrate/MigrationStorageController.php @@ -28,8 +28,8 @@ public function buildDependencyMigration(array $migrations, array $dynamic_ids) $dependency_graph = array(); $requirement_graph = array(); $different = FALSE; - /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ foreach ($migrations as $migration) { + /** @var \Drupal\migrate\Entity\MigrationInterface $migration */ $id = $migration->id(); $requirements[$id] = array(); $dependency_graph[$id]['edges'] = array(); diff --git a/core/modules/migrate/lib/Drupal/migrate/Plugin/MigrateEntityDestinationFieldInterface.php b/core/modules/migrate/lib/Drupal/migrate/Plugin/MigrateEntityDestinationFieldInterface.php index 6082a21..0fe3b86 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Plugin/MigrateEntityDestinationFieldInterface.php +++ b/core/modules/migrate/lib/Drupal/migrate/Plugin/MigrateEntityDestinationFieldInterface.php @@ -1,10 +1,11 @@ getIds(); $id_key = $this->getKey('id'); if (count($ids) > 1) { + // Ids is keyed by the key name so grab the keys. $id_keys = array_keys($ids); if (!$row->getDestinationProperty($id_key)) { + // Set the id into the destination in for form "val1.val2.val3". $row->setDestinationProperty($id_key, $this->generateId($row, $id_keys)); } } @@ -98,7 +100,7 @@ protected function updateEntityProperty(EntityInterface $entity, array $parents, /** * Generate an entity id. * - * @param Row $row + * @param \Drupal\migrate\Row $row * The current row. * @param array $ids * The destination ids. diff --git a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/process/Migration.php b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/process/Migration.php index 0a8e352..fca247e 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/process/Migration.php +++ b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/process/Migration.php @@ -25,7 +25,7 @@ * id = "migration" * ) */ -class Migration extends ProcessPluginBase implements ContainerFactoryPluginInterface { +class Migration extends ProcessPluginBase implements ContainerFactoryPluginInterface { /** * @var \Drupal\migrate\Plugin\MigratePluginManager diff --git a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/source/SourcePluginBase.php b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/source/SourcePluginBase.php index 7b1c92f..c4f497d 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/source/SourcePluginBase.php +++ b/core/modules/migrate/lib/Drupal/migrate/Plugin/migrate/source/SourcePluginBase.php @@ -35,8 +35,11 @@ public function __construct(array $configuration, $plugin_id, array $plugin_defi $this->migration = $migration; } - /** + /** + * Get the module handler. + * * @return \Drupal\Core\Extension\ModuleHandlerInterface + * The module handler. */ protected function getModuleHandler() { if (!isset($this->moduleHandler)) { @@ -49,10 +52,10 @@ protected function getModuleHandler() { * {@inheritdoc} */ public function prepareRow(Row $row) { - $resultHook = $this->getModuleHandler()->invokeAll('migrate_prepare_row', array($row, $this, $this->migration)); - $resultNamedHook = $this->getModuleHandler()->invokeAll('migrate_'. $this->migration->id() . '_prepare_row', array($row, $this, $this->migration)); + $result_hook = $this->getModuleHandler()->invokeAll('migrate_prepare_row', array($row, $this, $this->migration)); + $result_named_hook = $this->getModuleHandler()->invokeAll('migrate_'. $this->migration->id() . '_prepare_row', array($row, $this, $this->migration)); // If any of the hooks returned false, we want to skip the row. - if (($resultHook && in_array(FALSE, $resultHook)) || ($resultNamedHook && in_array(FALSE, $resultNamedHook))) { + if (($result_hook && in_array(FALSE, $result_hook)) || ($result_named_hook && in_array(FALSE, $result_named_hook))) { return FALSE; } } diff --git a/core/modules/migrate/lib/Drupal/migrate/Row.php b/core/modules/migrate/lib/Drupal/migrate/Row.php index 342b706..e9475f6 100644 --- a/core/modules/migrate/lib/Drupal/migrate/Row.php +++ b/core/modules/migrate/lib/Drupal/migrate/Row.php @@ -182,7 +182,7 @@ public function freezeSource() { * @param array|string $property * An array of properties on the destination. * - * @return boolean + * @return bool * TRUE if the destination property exists. */ public function hasDestinationProperty($property) { @@ -219,6 +219,7 @@ public function getDestination() { * @code * $this->destination['foo']['bar'] = 'baz'; * $this->rawDestination['foo.bar'] = 'baz'; + * @encode * * @return array * The raw destination values. diff --git a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateContactConfigsTest.php b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateContactConfigsTest.php index 0c2790d..3609266 100644 --- a/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateContactConfigsTest.php +++ b/core/modules/migrate_drupal/lib/Drupal/migrate_drupal/Tests/d6/MigrateContactConfigsTest.php @@ -49,7 +49,7 @@ public function setUp() { } /** - * Tests migration of aggregator variables to aggregator.settings.yml. + * Tests migration of contact variables to contact.settings.yml. */ public function testContactSettings() { $config = \Drupal::config('contact.settings');