You are here

public function BasicAuthTestSolrConnector::execute in Search API Solr 8.3

Same name and namespace in other branches
  1. 4.x tests/modules/search_api_solr_test/src/Plugin/SolrConnector/BasicAuthTestSolrConnector.php \Drupal\search_api_solr_test\Plugin\SolrConnector\BasicAuthTestSolrConnector::execute()

Executes any query.

Parameters

\Solarium\Core\Query\QueryInterface $query: The Solarium query object.

\Solarium\Core\Client\Endpoint|null $endpoint: (optional) The Solarium endpoint object.

Return value

\Solarium\Core\Query\Result\ResultInterface The Solarium result object.

Throws

\Drupal\search_api_solr\SearchApiSolrException

Overrides SolrConnectorPluginBase::execute

File

tests/modules/search_api_solr_test/src/Plugin/SolrConnector/BasicAuthTestSolrConnector.php, line 48

Class

BasicAuthTestSolrConnector
Basic auth Solr test connector.

Namespace

Drupal\search_api_solr_test\Plugin\SolrConnector

Code

public function execute(QueryInterface $query, Endpoint $endpoint = NULL) {
  self::$query = $query;
  if ($this->intercept) {

    /** @var \Solarium\Core\Query\AbstractQuery $query */
    return new Result($query, new Response(''));
  }
  return parent::execute($query, $endpoint);
}