You are here

public function SchedulingState::setNextScheduledTime in Webform Scheduled Tasks 8.2

Set the next scheduled time a task should run.

Parameters

\Drupal\webform_scheduled_tasks\Entity\WebformScheduledTaskInterface $scheduledTask: The scheduled task.

int $timestamp: The timestmap.

Overrides SchedulingStateInterface::setNextScheduledTime

File

src/SchedulingState.php, line 66

Class

SchedulingState
Get information about the state of task scheduling.

Namespace

Drupal\webform_scheduled_tasks

Code

public function setNextScheduledTime(WebformScheduledTaskInterface $scheduledTask, $timestamp) {
  $scheduled_times = $this->state
    ->get(static::SCHEDULE_STATE_KEY);
  $scheduled_times[$scheduledTask
    ->id()] = $timestamp;
  $this->state
    ->set(static::SCHEDULE_STATE_KEY, $scheduled_times);
}