You are here

public static function SiteSource::sources in Feeds 8.3

Adds sources to the $source array for this field.

Parameters

array $sources: The list of sources to modify.

\Drupal\feeds\FeedTypeInterface $feed_type: The feed type being added to.

array $definition: The plugin definition.

Overrides SourceInterface::sources

File

tests/modules/feeds_test_extra_sources/src/Feeds/Source/SiteSource.php, line 22

Class

SiteSource
A source exposing site config.

Namespace

Drupal\feeds_test_extra_sources\Feeds\Source

Code

public static function sources(array &$sources, FeedTypeInterface $feed_type, array $definition) {
  $sources['site:name'] = [
    'label' => t('Site name'),
    'id' => $definition['id'],
  ];
  $sources['site:mail'] = [
    'label' => t('Site mail'),
    'id' => $definition['id'],
  ];
  $sources['site:slogan'] = [
    'label' => t('Site slogan'),
    'id' => $definition['id'],
  ];
}