You are here

public function SavedSearch::setQuery in Search API Saved Searches 8

Sets the search query.

Parameters

\Drupal\search_api\Query\QueryInterface $query: The new query.

Return value

$this

Overrides SavedSearchInterface::setQuery

File

src/Entity/SavedSearch.php, line 540

Class

SavedSearch
Provides an entity type for saved searches.

Namespace

Drupal\search_api_saved_searches\Entity

Code

public function setQuery(QueryInterface $query) {
  $this->cachedProperties['query'] = $query;
  $this
    ->set('query', serialize($query));
  return $this;
}