You are here

function views_rss_map_assoc in Views RSS 8.2

Same name and namespace in other branches
  1. 8.3 views_rss.module \views_rss_map_assoc()
  2. 6.2 views_rss.module \views_rss_map_assoc()
  3. 7.2 views_rss.module \views_rss_map_assoc()

Forms associative array from linear array, or returns original array if already associative.

2 calls to views_rss_map_assoc()
RssFields::buildOptionsForm in src/Plugin/views/style/RssFields.php
Provide a form to edit options for this plugin.
RssFields::buildOptionsForm in src/Plugin/views/row/RssFields.php
Function buildOptionsForm.

File

./views_rss.module, line 140
Module providing fields-based views style plugin for RSS feed generation.

Code

function views_rss_map_assoc($array) {
  if (!(array_keys($array) !== range(0, count($array) - 1))) {
    $array = array_combine($array, $array);
  }
  return $array;
}