You are here

public function Migration::removeFieldMapping in Migrate 7.2

Same name and namespace in other branches
  1. 6.2 includes/migration.inc \Migration::removeFieldMapping()

Remove any existing coded mappings for a given destination or source field.

Parameters

string $destination_field: Name of the destination field.

string $source_field: Name of the source field.

5 calls to Migration::removeFieldMapping()
WineCommentMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.
WineCommentUpdatesMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.
WineFileBlobMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.
WineFileCopyMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.
WineTableMigration::__construct in migrate_example/wine.inc
General initialization of a Migration object.

File

includes/migration.inc, line 400
Defines the base class for import/rollback processes.

Class

Migration
The base class for all import objects. This is where most of the smarts of the migrate module resides. Migrations are created by deriving from this class, and in the constructor (after calling parent::__construct()) initializing at a minimum the name,…

Code

public function removeFieldMapping($destination_field, $source_field = NULL) {
  if (isset($destination_field)) {
    unset($this->codedFieldMappings[$destination_field]);
  }
  if (isset($source_field)) {
    foreach ($this->codedFieldMappings as $key => $mapping) {
      if ($mapping
        ->getSourceField() == $source_field) {
        unset($this->codedFieldMappings[$key]);
      }
    }
  }
}