You are here

protected function SearchApiViewsCache::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 SearchApiViewsCache::getSearchApiQuery()
SearchApiViewsCache::cache_get in contrib/search_api_views/includes/plugin_cache.inc
Overrides views_plugin_cache::cache_get().
SearchApiViewsCache::get_cache_key in contrib/search_api_views/includes/plugin_cache.inc
Overrides views_plugin_cache::get_cache_key().

File

contrib/search_api_views/includes/plugin_cache.inc, line 135
Contains the SearchApiViewsCache class.

Class

SearchApiViewsCache
Plugin class for caching Search API views.

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