function SearchPageFormBase::exists
Same name in other branches
- 9 core/modules/search/src/Form/SearchPageFormBase.php \Drupal\search\Form\SearchPageFormBase::exists()
- 10 core/modules/search/src/Form/SearchPageFormBase.php \Drupal\search\Form\SearchPageFormBase::exists()
- 11.x 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 121
Class
- SearchPageFormBase
- Provides a base form for search pages.
Namespace
Drupal\search\FormCode
public function exists($id) {
$entity = $this->entityTypeManager
->getStorage('search_page')
->getQuery()
->condition('id', $id)
->execute();
return (bool) $entity;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.