You are here

public function WebformScheduledTaskForm::resume in Webform Scheduled Tasks 8.2

File

src/Form/WebformScheduledTaskForm.php, line 205

Class

WebformScheduledTaskForm
The scheduled task form.

Namespace

Drupal\webform_scheduled_tasks\Form

Code

public function resume(array $form, FormStateInterface $form_state) {

  /** @var \Drupal\webform_scheduled_tasks\Entity\WebformScheduledTaskInterface $schedule */
  $schedule = $this->entity;

  // Resume the task, but queue it up to run from the current time to the next
  // interval.
  $this
    ->messenger()
    ->addStatus($this
    ->t('The scheduled task was resumed and will run during the next scheduled interval.'));
  $schedule
    ->incrementTaskRunDateByInterval();
  $schedule
    ->resume();
}