You are here

public function MigrateLocationFieldHandler::fields in Location 7.3

Implementation of MigrateFieldHandler::fields().

Parameters

string $type: The file field type - 'file' or 'image'

string $parent_field: Name of the parent field.

Migration $migration: The migration context for the parent field. We can look at the mappings and determine which subfields are relevant.

Return value

array Array of fields.

File

./location.migrate.inc, line 69
Migrate integration.

Class

MigrateLocationFieldHandler

Code

public function fields($type, $parent_field, $migration = NULL) {
  $dummy = array();
  $all_fields = location_invoke_locationapi($dummy, 'fields');
  unset($all_fields['locpick']);
  foreach ($all_fields as $field => $label) {
    $fields[$field] = t('Subfield: @label', array(
      '@label' => $label,
    ));
  }
  $fields['latitude'] = t('Subfield: Latitude');
  $fields['longitude'] = t('Subfield: Longitude');
  $fields['source'] = t('Subfield: Source value');
  $fields['is_primary'] = t('Subfield: Is primary');
  return $fields;
}