You are here

public static function Registrants::submitToggleCreateEntity in RNG - Events and Registrations 8

Same name and namespace in other branches
  1. 8.2 src/Element/Registrants.php \Drupal\rng\Element\Registrants::submitToggleCreateEntity()
  2. 3.x src/Element/Registrants.php \Drupal\rng\Element\Registrants::submitToggleCreateEntity()

Submission callback for toggling the create sub-form.

Parameters

array $form: The complete form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

File

src/Element/Registrants.php, line 1010

Class

Registrants
Provides a form element for a registrant and person association.

Namespace

Drupal\rng\Element

Code

public static function submitToggleCreateEntity(array $form, FormStateInterface $form_state) {
  $trigger = $form_state
    ->getTriggeringElement();
  $form_state
    ->setRebuild();
  $element = RegistrantsElement::findElement($form, $form_state);
  $utility = new RegistrantsElement($element, $form_state);
  $utility
    ->setShowCreateEntitySubform($trigger['#toggle_create_entity']);
}