You are here

public function FeedType::getMappingTargets in Feeds 8.3

Returns the mapping targets for this feed type.

Return value

array An array of mapping targets.

Overrides FeedTypeInterface::getMappingTargets

1 call to FeedType::getMappingTargets()
FeedType::getTargetPlugin in src/Entity/FeedType.php
@todo Use plugin bag.

File

src/Entity/FeedType.php, line 298

Class

FeedType
Defines the Feeds feed type entity.

Namespace

Drupal\feeds\Entity

Code

public function getMappingTargets() {
  if ($this->targets === NULL) {
    $this->targets = [];
    $definitions = \Drupal::service('plugin.manager.feeds.target')
      ->getDefinitions();
    foreach ($definitions as $definition) {
      $class = $definition['class'];
      $class::targets($this->targets, $this, $definition);
    }
    \Drupal::moduleHandler()
      ->alter('feeds_targets', $this->targets, $this);
  }
  return $this->targets;
}