apachesolr_current_query

Versions
5
apachesolr_current_query($query = NULL)
6
apachesolr_current_query($query = NULL, $namespace = 'apachesolr_search')

Static getter/setter for the current query

@todo reverse the order of parameters in future branches.

▾ 6 functions call apachesolr_current_query()

apachesolr_block in contributions/apachesolr/apachesolr.module
Implementation of hook_block().
apachesolr_do_query in contributions/apachesolr/apachesolr.module
Execute a search based on a query object.
apachesolr_l in contributions/apachesolr/apachesolr.module
A replacement for l()
apachesolr_og_block in contributions/apachesolr/contrib/apachesolr_og/apachesolr_og.module
Implementation of hook_block().
apachesolr_search_block in contributions/apachesolr/apachesolr_search.module
Implementation of hook_block().
apachesolr_search_form_search_form_alter in contributions/apachesolr/apachesolr_search.module
Implementation of hook_form_[form_id]_alter().

Code

contributions/apachesolr/apachesolr.module, line 1308

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

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters (without spaces) shown in the image.