You are here

public function WebformScheduledTask::getNextTaskRunDate in Webform Scheduled Tasks 8.2

Get the next run date for the task.

Return value

int A timestamp for when the task will run next.

Overrides WebformScheduledTaskInterface::getNextTaskRunDate

File

src/Entity/WebformScheduledTask.php, line 218

Class

WebformScheduledTask
Defines the webform schedule entity type.

Namespace

Drupal\webform_scheduled_tasks\Entity

Code

public function getNextTaskRunDate() {

  // If this task has not had a time scheduled and we have set both run
  // intervals, initialize the next run date of the task, to ensure this
  // method always return something usable in a scheduling context.
  if (!$this
    ->getScheduleState()
    ->hasTimeScheduled($this) && $this
    ->getRunIntervalMultiplier() !== NULL && $this
    ->getRunIntervalAmount() !== NULL) {
    $this
      ->incrementTaskRunDateByInterval();
  }
  return $this
    ->getScheduleState()
    ->getNextScheduledTime($this);
}