SearchPageFormBase::exists

public SearchPageFormBase::exists($id)

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 133

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;
}
doc_Drupal
2016-10-29 09:40:35
Comments
Leave a Comment

Please login to continue.