You are here

function apachesolr_static_response_cache in Apache Solr Search 6.2

Same name and namespace in other branches
  1. 8 apachesolr.module \apachesolr_static_response_cache()
  2. 5.2 apachesolr.module \apachesolr_static_response_cache()
  3. 5 apachesolr.module \apachesolr_static_response_cache()
  4. 6.3 apachesolr.module \apachesolr_static_response_cache()
  5. 6 apachesolr.module \apachesolr_static_response_cache()
  6. 7 apachesolr.module \apachesolr_static_response_cache()

It is important to hold on to the Solr response object for the duration of the page request so that we can use it for things like building facet blocks.

TODO: reverse the order of parameters in future branches.

6 calls to apachesolr_static_response_cache()
apachesolr_block in ./apachesolr.module
Implementation of hook_block().
apachesolr_date_block in contrib/apachesolr_date/apachesolr_date.module
Implementation of hook_block().
apachesolr_do_query in ./apachesolr.module
Execute a search based on a query object.
apachesolr_search_block in ./apachesolr_search.module
Implementation of hook_block().
apachesolr_search_browse in ./apachesolr_search.module
Execute an empty search (match all documents) and show a listing of all enabled facets.

... See full list

File

./apachesolr.module, line 1728
Integration with the Apache Solr search application.

Code

function apachesolr_static_response_cache($response = NULL, $namespace = 'apachesolr_search') {
  static $_response = array();
  if (is_object($response)) {
    $_response[$namespace] = clone $response;
  }
  if (!isset($_response[$namespace])) {
    $_response[$namespace] = NULL;
  }
  return $_response[$namespace];
}