You are here

protected function FeedsJSONPathParser::filterMappings in Feeds JSONPath Parser 7

Same name and namespace in other branches
  1. 6 FeedsJSONPathParser.inc \FeedsJSONPathParser::filterMappings()

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.

2 calls to FeedsJSONPathParser::filterMappings()
FeedsJSONPathParser::getMappingSources in ./FeedsJSONPathParser.inc
Override parent::getMappingSources().
FeedsJSONPathParser::getOwnMappings in ./FeedsJSONPathParser.inc
Gets the mappings that belong to this parser.

File

./FeedsJSONPathParser.inc, line 433
Contains FeedsJSONPathParser.

Class

FeedsJSONPathParser
Parses JSON using JSONPath.

Code

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