You are here

public function SearchPageFormBase::exists in Zircon Profile 8

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

Determines if the search page entity already exists.

Parameters

string $id: The search configuration ID.

Return value

bool TRUE if the search configuration exists, FALSE otherwise.

File

core/modules/search/src/Form/SearchPageFormBase.php, line 138
Contains \Drupal\search\Form\SearchPageFormBase.

Class

SearchPageFormBase
Provides a base form for search pages.

Namespace

Drupal\search\Form

Code

public function exists($id) {
  $entity = $this->entityQuery
    ->get('search_page')
    ->condition('id', $id)
    ->execute();
  return (bool) $entity;
}