You are here

public function SearchPageRepository::isSearchActive in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/search/src/SearchPageRepository.php \Drupal\search\SearchPageRepository::isSearchActive()

Returns whether search is active.

Return value

bool TRUE if at least one search is active, FALSE otherwise.

Overrides SearchPageRepositoryInterface::isSearchActive

File

core/modules/search/src/SearchPageRepository.php, line 58
Contains \Drupal\search\SearchPageRepository.

Class

SearchPageRepository
Provides a repository for Search Page config entities.

Namespace

Drupal\search

Code

public function isSearchActive() {
  return (bool) $this
    ->getQuery()
    ->condition('status', TRUE)
    ->range(0, 1)
    ->execute();
}