function SearchPage::values

Same name in this branch
  1. 9 core/modules/search/src/Plugin/migrate/source/d6/SearchPage.php \Drupal\search\Plugin\migrate\source\d6\SearchPage::values()
Same name and namespace in other branches
  1. 11.x core/modules/search/src/Plugin/migrate/source/d6/SearchPage.php \Drupal\search\Plugin\migrate\source\d6\SearchPage::values()
  2. 11.x core/modules/search/src/Plugin/migrate/source/d7/SearchPage.php \Drupal\search\Plugin\migrate\source\d7\SearchPage::values()

File

core/modules/search/src/Plugin/migrate/source/d7/SearchPage.php, line 34

Class

SearchPage
Drupal 7 search active core modules and rankings source from database.

Namespace

Drupal\search\Plugin\migrate\source\d7

Code

protected function values() {
  $search_active_modules = $this->variableGet('search_active_modules', '');
  $values = [];
  foreach ([
    'node',
    'user',
  ] as $module) {
    if (isset($search_active_modules[$module])) {
      // Add a module key to identify the source search provider. This value
      // is used in the EntitySearchPage destination plugin.
      $tmp = [
        'module' => $module,
        'status' => $search_active_modules[$module],
      ];
      // Add the node_rank_* variables (only relevant to the node module).
      if ($module === 'node') {
        $tmp = array_merge($tmp, parent::values());
      }
      $values[] = $tmp;
    }
  }
  return $values;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.