You are here

public function FeedsTermProcessor::getMappingTargets in Feeds 8.2

Return available mapping targets.

Overrides FeedsProcessor::getMappingTargets

File

lib/Drupal/feeds/Plugin/feeds/processor/FeedsTermProcessor.php, line 155
FeedsTermProcessor class.

Class

FeedsTermProcessor
Defines a taxonomy term processor.

Namespace

Drupal\feeds\Plugin\feeds\processor

Code

public function getMappingTargets() {
  $targets = parent::getMappingTargets();
  $targets += array(
    'name' => array(
      'name' => t('Term name'),
      'description' => t('Name of the taxonomy term.'),
      'optional_unique' => TRUE,
    ),
    'parent' => array(
      'name' => t('Parent: Term name'),
      'description' => t('The name of the parent taxonomy term.'),
      'optional_unique' => TRUE,
    ),
    'parentguid' => array(
      'name' => t('Parent: GUID'),
      'description' => t('The GUID of the parent taxonomy term.'),
      'optional_unique' => TRUE,
    ),
    'weight' => array(
      'name' => t('Term weight'),
      'description' => t('Weight of the taxonomy term.'),
      'optional_unique' => TRUE,
    ),
    'description' => array(
      'name' => t('Term description'),
      'description' => t('Description of the taxonomy term.'),
    ),
  );

  // Let implementers of hook_feeds_term_processor_targets() add their targets.
  try {
    self::loadMappers();
    $entity_type = $this
      ->entityType();
    $bundle = $this
      ->bundle();
    drupal_alter('feeds_processor_targets', $targets, $entity_type, $bundle);
  } catch (Exception $e) {

    // Do nothing.
  }
  return $targets;
}