You are here

public function MigrateDestinationEntityAPI::fields in Migrate Extras 7.2

Returns a list of fields available to be mapped for entities attached to a particular bundle.

Parameters

Migration $migration: Optionally, the migration containing this destination.

Return value

array Keys: machine names of the fields (to be passed to addFieldMapping) Values: Human-friendly descriptions of the fields.

Overrides MigrateDestination::fields

File

./entity_api.inc, line 124
Support for entity types implementing the Entity API.

Class

MigrateDestinationEntityAPI
Destination class implementing migration into entity types.

Code

public function fields($migration = NULL) {
  $properties = entity_get_property_info($this->entityType);
  $fields = array();
  foreach ($properties['properties'] as $name => $property_info) {
    if (isset($property_info['setter callback'])) {
      $fields[$name] = $property_info['description'];
    }
  }

  // Then add in anything provided by handlers
  $fields += migrate_handler_invoke_all('Entity', 'fields', $this->entityType, $this->bundle);
  return $fields;
}