You are here

public function FeedTypeTamperMeta::getUniqueSourceList in Feeds Tamper 8.2

Returns an unique list of sources used in mappings.

Return value

string[] A list of sources.

Overrides FeedTypeTamperMetaInterface::getUniqueSourceList

1 call to FeedTypeTamperMeta::getUniqueSourceList()
FeedTypeTamperMeta::rectifyInstances in src/FeedTypeTamperMeta.php
Removes tamper instances whose source was removed from the mapping.

File

src/FeedTypeTamperMeta.php, line 168

Class

FeedTypeTamperMeta
Class for managing tamper plugins for a feed type.

Namespace

Drupal\feeds_tamper

Code

public function getUniqueSourceList() {

  // Extract used sources from mappings.
  $sources = [];
  foreach ($this->feedType
    ->getMappings() as $mapping) {
    foreach ($mapping['map'] as $column => $source) {
      if ($source == '') {
        continue;
      }
      $sources[$source] = $source;
    }
  }
  return $sources;
}