You are here

public function UrlRedirectForm::exist in Url Redirect 8.2

Same name and namespace in other branches
  1. 8 src/Form/UrlRedirectForm.php \Drupal\url_redirect\Form\UrlRedirectForm::exist()

Helper function to check whether an UrlRedirect configuration entity exists.

File

src/Form/UrlRedirectForm.php, line 230

Class

UrlRedirectForm
Form handler for the Example add and edit forms.

Namespace

Drupal\url_redirect\Form

Code

public function exist($id) {
  $storage = $this->entityTypeManagerInterface
    ->getStorage('url_redirect');
  $entity = $storage
    ->getQuery()
    ->condition('id', $id)
    ->execute();
  return (bool) $entity;
}