You are here

public function SearchPluginBase::setSearch in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/search/src/Plugin/SearchPluginBase.php \Drupal\search\Plugin\SearchPluginBase::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

\Drupal\search\Plugin\SearchInterface A search plugin object for chaining.

Overrides SearchInterface::setSearch

1 call to SearchPluginBase::setSearch()
SearchExtraTypeSearch::setSearch in core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php
Sets the keywords, parameters, and attributes to be used by execute().
1 method overrides SearchPluginBase::setSearch()
SearchExtraTypeSearch::setSearch in core/modules/search/tests/modules/search_extra_type/src/Plugin/Search/SearchExtraTypeSearch.php
Sets the keywords, parameters, and attributes to be used by execute().

File

core/modules/search/src/Plugin/SearchPluginBase.php, line 56
Contains \Drupal\search\Plugin\SearchPluginBase.

Class

SearchPluginBase
Defines a base class for plugins wishing to support search.

Namespace

Drupal\search\Plugin

Code

public function setSearch($keywords, array $parameters, array $attributes) {
  $this->keywords = (string) $keywords;
  $this->searchParameters = $parameters;
  $this->searchAttributes = $attributes;
  return $this;
}