You are here

public function WebformCompositeForm::exists in Webform Composite Tools 8

Helper function to check whether an composite id is already in use.

Return value

bool True if a composite exists with the given id. FALSE otherwise.

File

src/Form/WebformCompositeForm.php, line 185

Class

WebformCompositeForm
Form handler for the Composite add and edit forms.

Namespace

Drupal\webform_composite\Form

Code

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