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

1
2
3
4
5
6
public function exists($id) {
  $entity = $this->entityQuery->get('search_page')
    ->condition('id', $id)
    ->execute();
  return (bool) $entity;
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.