You are here

public function Query::abort in Search API 8

Aborts this query.

This will mean that, while the query object otherwise acts normally, it won't be passed to the server and won't return any results.

Parameters

\Drupal\Component\Render\MarkupInterface|string|null $error_message: (optional) A translated error message explaining the reason why the query was aborted.

Return value

$this

Overrides QueryInterface::abort

File

src/Query/Query.php, line 498

Class

Query
Provides a standard implementation for a Search API query.

Namespace

Drupal\search_api\Query

Code

public function abort($error_message = NULL) {
  $this->aborted = $error_message ?? TRUE;
}