You are here

public function DeleteExpressionForm::submitForm in Rules 8.3

Form submission handler.

Parameters

array $form: An associative array containing the structure of the form.

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

Overrides FormInterface::submitForm

File

src/Form/DeleteExpressionForm.php, line 78

Class

DeleteExpressionForm
Removes an expression from a rule.

Namespace

Drupal\rules\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $component = $this->rulesUiHandler
    ->getComponent();
  $component
    ->getExpression()
    ->deleteExpression($this->uuid);
  $this->rulesUiHandler
    ->updateComponent($component);
  $form_state
    ->setRedirectUrl($this
    ->getCancelUrl());
}