You are here

public function SitemapParser::getMappingSources in Feeds 8.3

Declare the possible mapping sources that this parser produces.

@todo Get rid of the false return here and create a configurable source solution for parsers. @todo Add type data here for automatic mappings. @todo Provide code example.

Return value

array|false An array of mapping sources, or false if the sources can be defined by typing a value in a text field.

Overrides ParserInterface::getMappingSources

File

src/Feeds/Parser/SitemapParser.php, line 70

Class

SitemapParser
Defines a SitemapXML feed parser.

Namespace

Drupal\feeds\Feeds\Parser

Code

public function getMappingSources() {
  return [
    'url' => [
      'label' => $this
        ->t('Item URL (link)'),
      'description' => $this
        ->t('URL of the feed item.'),
      'suggestions' => [
        'targets' => [
          'url',
        ],
      ],
    ],
    'lastmod' => [
      'label' => $this
        ->t('Last modification date'),
      'description' => $this
        ->t('Last modified date as UNIX time GMT of the feed item.'),
    ],
    'changefreq' => [
      'label' => $this
        ->t('Change frequency'),
      'description' => $this
        ->t('How frequently the page is likely to change.'),
    ],
    'priority' => [
      'label' => $this
        ->t('Priority'),
      'description' => $this
        ->t('The priority of this URL relative to other URLs on the site.'),
    ],
  ];
}