public function ReleaseJob::submitForm in Advanced Queue 8
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/ ReleaseJob.php, line 66
Class
- ReleaseJob
- Provides a confirmation form for releasing a job.
Namespace
Drupal\advancedqueue\FormCode
public function submitForm(array &$form, FormStateInterface $form_state) {
$queue_backend = $this->queue
->getBackend();
if ($queue_backend instanceof SupportsReleasingJobsInterface) {
$queue_backend
->releaseJob($this->jobId);
}
$this
->messenger()
->addStatus($this
->t('Job @job_id has been released.', [
'@job_id' => $this->jobId,
]));
$form_state
->setRedirectUrl($this
->getCancelUrl());
}