function NodeTranslationMigrateSubscriber::isNodeTranslationsMigration
Same name in other branches
- 8.9.x core/modules/node/src/EventSubscriber/NodeTranslationMigrateSubscriber.php \Drupal\node\EventSubscriber\NodeTranslationMigrateSubscriber::isNodeTranslationsMigration()
- 10 core/modules/node/src/EventSubscriber/NodeTranslationMigrateSubscriber.php \Drupal\node\EventSubscriber\NodeTranslationMigrateSubscriber::isNodeTranslationsMigration()
- 11.x core/modules/node/src/EventSubscriber/NodeTranslationMigrateSubscriber.php \Drupal\node\EventSubscriber\NodeTranslationMigrateSubscriber::isNodeTranslationsMigration()
Helper method to check if we are migrating translated nodes.
Parameters
\Drupal\migrate\Event\EventBase $event: The migrate event.
Return value
bool True if we are migrating translated nodes, false otherwise.
2 calls to NodeTranslationMigrateSubscriber::isNodeTranslationsMigration()
- NodeTranslationMigrateSubscriber::onPostImport in core/
modules/ node/ src/ EventSubscriber/ NodeTranslationMigrateSubscriber.php - Set the node_translation_redirect state to enable the redirections.
- NodeTranslationMigrateSubscriber::onPostRowSave in core/
modules/ node/ src/ EventSubscriber/ NodeTranslationMigrateSubscriber.php - Maps the old nid to the new one in the key value collection.
File
-
core/
modules/ node/ src/ EventSubscriber/ NodeTranslationMigrateSubscriber.php, line 66
Class
- NodeTranslationMigrateSubscriber
- Creates a key value collection for migrated node translation redirections.
Namespace
Drupal\node\EventSubscriberCode
protected function isNodeTranslationsMigration(EventBase $event) {
$migration = $event->getMigration();
$source_configuration = $migration->getSourceConfiguration();
$destination_configuration = $migration->getDestinationConfiguration();
return !empty($source_configuration['translations']) && $destination_configuration['plugin'] === 'entity:node';
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.