You are here

public function FeedTypeTamperMeta::getSourceDefinition in Feeds Tamper 8.2

Returns a definition of sources.

Return value

\Drupal\tamper\SourceDefinitionInterface A source definition, which can be used by Tamper plugins.

Overrides FeedTypeTamperMetaInterface::getSourceDefinition

2 calls to FeedTypeTamperMeta::getSourceDefinition()
FeedTypeTamperMeta::addTamper in src/FeedTypeTamperMeta.php
Adds a tamper plugin instance for this feed type.
FeedTypeTamperMeta::getTampers in src/FeedTypeTamperMeta.php
Returns the tamper plugin instances for this feed type.

File

src/FeedTypeTamperMeta.php, line 186

Class

FeedTypeTamperMeta
Class for managing tamper plugins for a feed type.

Namespace

Drupal\feeds_tamper

Code

public function getSourceDefinition() {
  $source_list = [];
  foreach ($this->feedType
    ->getMappingSources() as $key => $source) {
    $source_list[$key] = isset($source['label']) ? $source['label'] : $key;
  }
  return new SourceDefinition($source_list);
}