You are here

public function ParagraphsCategoryForm::exist in Paragraphs Editor Enhancements 8

Helper function to check whether a Paragraphs category entity exists.

File

src/Form/ParagraphsCategoryForm.php, line 101

Class

ParagraphsCategoryForm
Form handler for the add and edit forms of Paragraphs category entities.

Namespace

Drupal\paragraphs_ee\Form

Code

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