You are here

public function SolrConnectorPluginBase::getQueryHelper in Search API Solr 8.2

Same name and namespace in other branches
  1. 8.3 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::getQueryHelper()
  2. 8 src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::getQueryHelper()
  3. 4.x src/SolrConnector/SolrConnectorPluginBase.php \Drupal\search_api_solr\SolrConnector\SolrConnectorPluginBase::getQueryHelper()

Returns a Solarium query helper object.

Parameters

\Solarium\Core\Query\QueryInterface|null $query: (optional) A Solarium query object.

Return value

\Solarium\Core\Query\Helper A Solarium query helper.

Overrides SolrConnectorInterface::getQueryHelper

File

src/SolrConnector/SolrConnectorPluginBase.php, line 724

Class

SolrConnectorPluginBase
Defines a base class for Solr connector plugins.

Namespace

Drupal\search_api_solr\SolrConnector

Code

public function getQueryHelper(QueryInterface $query = NULL) {
  if ($query) {
    return $query
      ->getHelper();
  }
  return \Drupal::service('solarium.query_helper');
}