You are here

public function CorrespondingReferenceForm::exists in Corresponding Entity References 8.4

Helper function to check whether a corresponding reference configuration entity exists.

File

src/Form/CorrespondingReferenceForm.php, line 143

Class

CorrespondingReferenceForm
Form handler for corresponding reference add and edit forms.

Namespace

Drupal\cer\Form

Code

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