You are here

public function RegistrationTypeForm::exists in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 src/Form/RegistrationTypeForm.php \Drupal\rng\Form\RegistrationTypeForm::exists()
  2. 3.x src/Form/RegistrationTypeForm.php \Drupal\rng\Form\RegistrationTypeForm::exists()

Callback for `id` form element in RegistrationTypeForm->buildForm.

File

src/Form/RegistrationTypeForm.php, line 81

Class

RegistrationTypeForm
Form controller for registration types.

Namespace

Drupal\rng\Form

Code

public function exists($entity_id, array $element, FormStateInterface $form_state) {
  $query = $this->entityQueryFactory
    ->get('registration_type');
  return (bool) $query
    ->condition('id', $entity_id)
    ->execute();
}