You are here

public function MaestroTraceDeleteTask::submitForm in Maestro 8.2

Same name and namespace in other branches
  1. 3.x src/Form/MaestroTraceDeleteTask.php \Drupal\maestro\Form\MaestroTraceDeleteTask::submitForm()

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/MaestroTraceDeleteTask.php, line 87

Class

MaestroTraceDeleteTask
The confirm form for deleting a task.

Namespace

Drupal\maestro\Form

Code

public function submitForm(array &$form, FormStateInterface $form_state) {
  $ids = explode(',', $this->id);
  foreach ($ids as $queueID) {
    if ($queueID != '') {
      $queueRecord = MaestroEngine::getQueueEntryById($queueID);
      $queueRecord
        ->delete();
    }
  }
  $form_state
    ->setRedirect('maestro.trace', [
    'processID' => $this->processID,
  ]);
}