function NodeCompleteNodeLookup::transform

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

Overrides ProcessPluginBase::transform

File

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

Class

NodeCompleteNodeLookup
Returns only the nid 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[0];
    }
    return $value;
}

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