You are here

public function MigrateNodewordsNodeHandler::prepare in Migrate Extras 6.2

Move the nodewords fields into the appropriate structure for the nodewords module to handle them on update/insert.

File

./nodewords.inc, line 38
Support for importing META information into the Nodewords module.

Class

MigrateNodewordsNodeHandler
@file Support for importing META information into the Nodewords module.

Code

public function prepare($node, stdClass $row) {
  if (module_exists('nodewords')) {
    foreach ($this
      ->fields() as $full_field => $label) {
      if (isset($node->{$full_field})) {
        $field = substr($full_field, strlen('nodewords_'));
        $node->nodewords[$field]['value'] = $node->{$full_field};
        unset($node->{$full_field});
      }
    }
  }
}