You are here

function apachesolr_current_query in Apache Solr Search 6

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

Static getter/setter for the current query

@todo reverse the order of parameters in future branches.

7 calls to apachesolr_current_query()
apachesolr_block in ./apachesolr.module
Implementation of hook_block().
apachesolr_do_query in ./apachesolr.module
Execute a search based on a query object.
apachesolr_l in ./apachesolr.module
A replacement for l()
apachesolr_og_block in contrib/apachesolr_og/apachesolr_og.module
Implementation of hook_block().
apachesolr_search_block in ./apachesolr_search.module
Implementation of hook_block().

... See full list

File

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

Code

function apachesolr_current_query($query = NULL, $namespace = 'apachesolr_search') {
  static $saved_query = array();
  if (is_object($query)) {
    $saved_query[$namespace] = clone $query;
  }
  return is_object($saved_query[$namespace]) ? clone $saved_query[$namespace] : NULL;
}