You are here

public function SearchApiSavedSearchesSettings::index in Search API Saved Searches 7

Return value

SearchApiIndex The index these saved search settings are for.

Throws

SearchApiException If the index doesn't exist.

File

./search_api_saved_searches.settings_entity.inc, line 62
Contains the entity class for stored "Saved searches" settings of search indexes.

Class

SearchApiSavedSearchesSettings
Class representing "Saved searches" settings.

Code

public function index() {
  if (!isset($this->index)) {
    $this->index = search_api_index_load($this->index_id);
  }
  if (!$this->index) {
    throw new SearchApiException(t("The index with the ID %id doesn't exist, but has saved search settings attached.", array(
      '%id' => $this->index_id,
    )));
  }
  return $this->index;
}