You are here

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

Return value

SearchApiIndex The index this saved search uses.

Throws

SearchApiException If the index doesn't exist.

1 call to SearchApiSavedSearch::index()
SearchApiSavedSearch::query in ./search_api_saved_searches.search_entity.inc

File

./search_api_saved_searches.search_entity.inc, line 176
Contains the entity class for saved searches.

Class

SearchApiSavedSearch
Class representing "Saved searches" settings.

Code

public function index() {
  if (!isset($this->index)) {
    $this->index = search_api_index_load($this
      ->settings()->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
        ->settings()->index_id,
    )));
  }
  return $this->index;
}