You are here

function migrate_save_content_mapping in Migrate 6

Save a new or updated content mapping

Parameters

$mapping: An object representing the mapping. This is passed by reference (so when adding a new mapping the ID can be set)

Return value

The ID of the mapping that was saved, or NULL if nothing was saved

4 calls to migrate_save_content_mapping()
MigrateCommentTest::testComment in tests/modules/core/migrate_comment.test
Test comment migration
MigrateNodeTest::testNodeProcessing in tests/modules/core/migrate_node.test
Test UI for processing
MigrateUserTest::testUserProcessing in tests/modules/core/migrate_user.test
Test user migration
migrate_content_set_mappings_submit in ./migrate_pages.inc
Implementation of hook_submit().

File

./migrate.module, line 286
This module provides tools at "administer >> content >> migrate" for analyzing data from various sources and importing them into Drupal tables.

Code

function migrate_save_content_mapping(&$mapping) {
  if ($mapping->mcmid) {
    drupal_write_record('migrate_content_mappings', $mapping, 'mcmid');
  }
  else {
    drupal_write_record('migrate_content_mappings', $mapping);
  }
  return $mapping->mcmid;
}