You are here

protected function Facet::pickQueryType in Facets 8

Choose the query type.

Parameters

array $allTypes: An array of query type definitions.

string $type: The chose query type.

Return value

string The class name of the chose query type.

Throws

\Drupal\facets\Exception\InvalidQueryTypeException

1 call to Facet::pickQueryType()
Facet::getQueryType in src/Entity/Facet.php
Returns the query type instance.

File

src/Entity/Facet.php, line 517

Class

Facet
Defines the facet configuration entity.

Namespace

Drupal\facets\Entity

Code

protected function pickQueryType(array $allTypes, $type) {
  if (!isset($allTypes[$type])) {
    throw new InvalidQueryTypeException("Query type {$type} doesn't exist.");
  }
  return $allTypes[$type];
}