You are here

public function AddToCalForm::submitForm in Add to Cal 8

Parameters

array $form:

\Drupal\Core\Form\FormStateInterface $form_state:

Overrides FormInterface::submitForm

File

src/Form/AddToCalForm.php, line 137

Class

AddToCalForm
Class AddToCalForm

Namespace

Drupal\addtocal\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $values = $form_state
    ->getValues();
  $entity = $values['entity'];
  $settings = $values['settings'];
  $delta = $values['delta'];
  $type = $values['type'];

  /** @var AddToCalTypeManager $manager */
  $manager = \Drupal::service('plugin.manager.addtocal.type');
  $instance = $manager
    ->createInstance($type);

  // Process the plugin submit
  $instance
    ->downloadSubmit($entity, $settings, $delta, $form_state);
}