You are here

public function CRMFeedsContactProcessor::getMappingTargets in CRM Core 8.2

Same name and namespace in other branches
  1. 8.3 modules/crm_core_contact/legacy/ \CRMFeedsContactProcessor::getMappingTargets()
  2. 8 modules/crm_core_contact/legacy/ \CRMFeedsContactProcessor::getMappingTargets()
  3. 7 modules/crm_core_contact/includes/ \CRMFeedsContactProcessor::getMappingTargets()

Return available mapping targets.


modules/crm_core_contact/legacy/, line 217
Class definition of CRMFeedsContactProcessor.


Creates contacts from feed items.


public function getMappingTargets() {
  $types = ContactType::loadMultiple();
  $type = $types[$this->config['contact_type']];
  $targets = parent::getMappingTargets();
  $targets += array(
    'contact_id' => array(
      'name' => t('Contact ID'),
      'description' => t('The contact_id of the contact. NOTE: use this feature with care, contact ids are usually assigned by Drupal.'),
      'optional_unique' => TRUE,
    'uid' => array(
      'name' => t('User ID'),
      'description' => t('The Drupal user ID of the contact author.'),
    'created' => array(
      'name' => t('Created date'),
      'description' => t('The UNIX time when a contact has been created.'),

  // If the target content type is a Feed contact, expose its source field.
  if ($id = feeds_get_importer_id($this->config['contact_type'])) {
    $name = feeds_importer($id)->config['name'];
    $targets['feeds_source'] = array(
      'name' => t('Feed source'),
      'description' => t('The contact type created by this processor is a Feed Node, it represents a source itself. Depending on the fetcher selected on the importer "@importer", this field is expected to be for example a URL or a path to a file.', array(
        '@importer' => $name,
      'optional_unique' => TRUE,

  // Let other modules expose mapping targets.
  feeds_alter('feeds_processor_targets', $targets, 'crm_core_contact', $this->config['contact_type']);
  return $targets;