You are here

public function Query::getOption in Search API 8

Retrieves an option set on this search query.

Parameters

string $name: The name of the option.

mixed $default: (optional) The value to return if the specified option is not set.

Return value

mixed The value of the option with the specified name, if set. $default otherwise.

Overrides QueryInterface::getOption

1 call to Query::getOption()
Query::setOption in src/Query/Query.php
Sets an option for this search query.

File

src/Query/Query.php, line 692

Class

Query
Provides a standard implementation for a Search API query.

Namespace

Drupal\search_api\Query

Code

public function getOption($name, $default = NULL) {
  return array_key_exists($name, $this->options) ? $this->options[$name] : $default;
}