You are here

protected function SearchPage::values in Drupal 8

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

Return the values of the variables specified in the plugin configuration.

Return value

array An associative array where the keys are the variables specified in the plugin configuration and the values are the values found in the source. Only those values are returned that are actually in the database.

Overrides Variable::values

1 call to SearchPage::values()
SearchPage::initializeIterator in core/modules/search/src/Plugin/migrate/source/d7/SearchPage.php
Initializes the iterator with the source data.

File

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

Class

SearchPage
Get search_active_modules and rankings for core modules.

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;
}