You are here

protected function ParserBase::filterMappings in Feeds XPath Parser 8

Filters mappings, returning the ones that belong to us.

Parameters

array $mappings: A mapping array from a processor.

Return value

array An array of mappings keyed source => target.

1 call to ParserBase::filterMappings()
ParserBase::getOwnMappings in lib/Drupal/feeds_xpathparser/ParserBase.php
Gets the mappings that are defined by this parser.

File

lib/Drupal/feeds_xpathparser/ParserBase.php, line 572
Contains \Drupal\feeds_xpathparser\ParserBase.

Class

ParserBase
Base class for the HTML and XML parsers.

Namespace

Drupal\feeds_xpathparser

Code

protected function filterMappings(array $mappings) {
  $our_mappings = array();
  foreach ($mappings as $mapping) {
    if (strpos($mapping['source'], 'xpathparser:') === 0) {
      $our_mappings[$mapping['source']] = $mapping['target'];
    }
  }
  return $our_mappings;
}