public function SchedulingState::haltTask in Webform Scheduled Tasks 8.2
Halt a scheduled task.
Parameters
\Drupal\webform_scheduled_tasks\Entity\WebformScheduledTaskInterface $scheduledTask: The task.
string $message: (Optional) The message to provide the user.
Overrides SchedulingStateInterface::haltTask
File
- src/
SchedulingState.php, line 94
Class
- SchedulingState
- Get information about the state of task scheduling.
Namespace
Drupal\webform_scheduled_tasksCode
public function haltTask(WebformScheduledTaskInterface $scheduledTask, $message = '') {
$halted_tasks = $this->state
->get(static::HALTED_STATE_KEY);
$halted_tasks[$scheduledTask
->id()] = $message;
$this->state
->set(static::HALTED_STATE_KEY, $halted_tasks);
}