You are here

public function FeedsJSONPathParser::getMappingSources in Feeds JSONPath Parser 7

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

Override parent::getMappingSources().

File

./FeedsJSONPathParser.inc, line 333
Contains FeedsJSONPathParser.

Class

FeedsJSONPathParser
Parses JSON using JSONPath.

Code

public function getMappingSources() {
  $mappings = $this
    ->filterMappings(feeds_importer($this->id)->processor->config['mappings']);
  $next = 0;
  if (!empty($mappings)) {
    $keys = array_keys($mappings);
    $nums = array();
    foreach ($keys as $key) {
      list(, $num) = explode(':', $key);
      $nums[] = $num;
    }
    $max = max($nums);
    $next = ++$max;
  }
  return array(
    'jsonpath_parser:' . $next => array(
      'name' => t('JSONPath Expression'),
      'description' => t('Allows you to configure a JSONPath expression that will populate this field.'),
    ),
  ) + parent::getMappingSources();
}