You are here

public function SearchExtraTypeSearch::setSearch in Drupal 10

Same name and namespace in other branches
  1. 8 core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php \Drupal\search_extra_type\Plugin\Search\SearchExtraTypeSearch::setSearch()
  2. 9 core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php \Drupal\search_extra_type\Plugin\Search\SearchExtraTypeSearch::setSearch()

Sets the keywords, parameters, and attributes to be used by execute().

Parameters

string $keywords: The keywords to use in a search.

array $parameters: Array of parameters as an associative array. This is expected to be the query string from the current request.

array $attributes: Array of attributes, usually from the current request object.

Return value

$this A search plugin object for chaining.

Overrides SearchPluginBase::setSearch

File

core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php, line 24

Class

SearchExtraTypeSearch
Executes a dummy keyword search.

Namespace

Drupal\search_extra_type\Plugin\Search

Code

public function setSearch($keywords, array $parameters, array $attributes) {
  if (empty($parameters['search_conditions'])) {
    $parameters['search_conditions'] = '';
  }
  parent::setSearch($keywords, $parameters, $attributes);
}