protected function SearchApiViewsContentCache::getSearchApiQuery in Search API 7
Retrieves the Search API query object associated with the current view.
Return value
SearchApiQueryInterface|null The Search API query object associated with the current view; or NULL if there is none.
2 calls to SearchApiViewsContentCache::getSearchApiQuery()
- SearchApiViewsContentCache::cache_get in contrib/
search_api_views/ includes/ plugin_content_cache.inc - Overrides views_plugin_cache::cache_get().
- SearchApiViewsContentCache::get_cache_key in contrib/
search_api_views/ includes/ plugin_content_cache.inc - Overrides views_plugin_cache::get_cache_key().
File
- contrib/
search_api_views/ includes/ plugin_content_cache.inc, line 135 - Contains the SearchApiViewsContentCache class.
Class
- SearchApiViewsContentCache
- Plugin class for caching Search API views, with additional invalidation.
Code
protected function getSearchApiQuery() {
if (!isset($this->search_api_query)) {
$this->search_api_query = FALSE;
if (isset($this->view->query) && $this->view->query instanceof SearchApiViewsQuery) {
$this->search_api_query = $this->view->query
->getSearchApiQuery();
}
}
return $this->search_api_query ? $this->search_api_query : NULL;
}