public static function Query::create in Search API 8
Instantiates a new instance of this query class.
Parameters
\Drupal\search_api\IndexInterface $index: The index for which the query should be created.
array $options: (optional) The options to set for the query.
Return value
static A query object to use.
Throws
\Drupal\search_api\SearchApiException Thrown if a search on that index (or with those options) won't be possible.
Overrides QueryInterface::create
3 calls to Query::create()
- QueryHelper::createQuery in src/
Utility/ QueryHelper.php - Creates a new search query object.
- QueryTest::testQuerySerialization in tests/
src/ Kernel/ System/ QueryTest.php - Tests that serialization of queries works correctly.
- TestItemsTrait::setUpMockContainer in tests/
src/ Unit/ Processor/ TestItemsTrait.php - Adds a container with several mock services commonly needed by our tests.
File
- src/
Query/ Query.php, line 229
Class
- Query
- Provides a standard implementation for a Search API query.
Namespace
Drupal\search_api\QueryCode
public static function create(IndexInterface $index, array $options = []) {
return new static($index, $options);
}