You are here

function farm_equipment_feeds_importer_default_alter in farmOS 7

Implements hook_feeds_importer_default_alter().

File

modules/farm/farm_equipment/farm_equipment.module, line 56

Code

function farm_equipment_feeds_importer_default_alter($importers) {

  // Add extra field mappings to equipment.
  $name = 'farm_asset_equipment';
  if (!empty($importers[$name])) {
    $mappings = array(
      array(
        'source' => 'Manufacturer',
        'target' => 'field_farm_manufacturer',
        'unique' => FALSE,
        'language' => 'und',
      ),
      array(
        'source' => 'Model',
        'target' => 'field_farm_model',
        'unique' => FALSE,
        'language' => 'und',
      ),
      array(
        'source' => 'Serial number',
        'target' => 'field_farm_serial_number',
        'unique' => FALSE,
        'language' => 'und',
      ),
    );
    $importer_mappings =& $importers[$name]->config['processor']['config']['mappings'];
    $importer_mappings = array_merge($importer_mappings, $mappings);
  }
}