You are here

public function CRMFeedsActivityProcessor::getMappingTargets in CRM Core 8.2

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

Return available mapping targets.


modules/crm_core_activity/legacy/, line 237
Class definition of CRMFeedsActivityProcessor.


Creates activities from feed items.


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

  // If the target content type is a Feed activity, expose its source field.
  if ($id = feeds_get_importer_id($this->config['activity_type'])) {
    $name = feeds_importer($id)->config['name'];
    $targets['feeds_source'] = array(
      'name' => t('Feed source'),
      'description' => t('The activity 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_activity', $this->config['activity_type']);
  return $targets;