You are here

protected function Rss::defineOptions in Podcast (using Views) 8

Information about options for all kinds of purposes will be held here.


'option_name' => array(
 - 'default' => default value,
 - 'contains' => (optional) array of items this contains, with its own
     defaults, etc. If contains is set, the default will be ignored and
     assumed to be array().
 ),

Return value

array Returns the options of this handler/plugin.

Overrides Rss::defineOptions

File

src/Plugin/views/style/Rss.php, line 31

Class

Rss
Default style plugin to render an RSS feed.

Namespace

Drupal\podcast\Plugin\views\style

Code

protected function defineOptions() {
  $options = parent::defineOptions();
  unset($options['description']);
  $keys = [
    'copyright',
    'title_field',
    'description_field',
    'link_field',
    'author_field',
    'lastBuildDate_field',
    'itunes:explicit_field',
    'itunes:owner--name_field',
    'itunes:owner--email_field',
    'itunes:author_field',
    'itunes:summary_field',
    'itunes:keywords_field',
    'itunes:image_field',
    'itunes:category_field',
    'itunes:new-feed-url_field',
  ];
  $options = array_reduce($keys, function ($options, $key) {
    $options[$key] = [
      'default' => '',
    ];
    return $options;
  }, $options);
  $options['generator'] = [
    'default' => 'Podcast module for Drupal',
  ];
  return $options;
}