You are here

public function ParserBase::getMappingSources in Feeds XPath Parser 8

File

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

Class

ParserBase
Base class for the HTML and XML parsers.

Namespace

Drupal\feeds_xpathparser

Code

public function getMappingSources() {
  $mappings = $this
    ->getOwnMappings();
  $next = 0;
  if (!empty($mappings)) {

    // Mappings can be re-ordered, so find the max.
    foreach (array_keys($mappings) as $key) {
      list(, $index) = explode(':', $key);
      if ($index > $next) {
        $next = $index;
      }
    }
    $next++;
  }
  return array(
    'xpathparser:' . $next => array(
      'name' => t('XPath Expression'),
      'description' => t('Allows you to configure an XPath expression that will populate this field.'),
    ),
  ) + parent::getMappingSources();
}