function NodeCompleteNodeRevisionLookup::transform

Same name in other branches
  1. 9 core/modules/migrate_drupal/src/Plugin/migrate/process/NodeCompleteNodeRevisionLookup.php \Drupal\migrate_drupal\Plugin\migrate\process\NodeCompleteNodeRevisionLookup::transform()
  2. 8.9.x core/modules/migrate_drupal/src/Plugin/migrate/process/NodeCompleteNodeRevisionLookup.php \Drupal\migrate_drupal\Plugin\migrate\process\NodeCompleteNodeRevisionLookup::transform()
  3. 11.x core/modules/migrate_drupal/src/Plugin/migrate/process/NodeCompleteNodeRevisionLookup.php \Drupal\migrate_drupal\Plugin\migrate\process\NodeCompleteNodeRevisionLookup::transform()

Overrides ProcessPluginBase::transform

File

core/modules/migrate_drupal/src/Plugin/migrate/process/NodeCompleteNodeRevisionLookup.php, line 28

Class

NodeCompleteNodeRevisionLookup
Returns only the vid from migration_lookup on node_complete migration.

Namespace

Drupal\migrate_drupal\Plugin\migrate\process

Code

public function transform($value, MigrateExecutableInterface $migrate_executable, Row $row, $destination_property) {
    if (is_array($value) && count($value) === 3) {
        return $value[1];
    }
    return $value;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.