You are here

public function Job::setState in Advanced Queue 8

Sets the job state.

Parameters

string $state: The job state, a Job::STATE_ constant.

Return value

$this

File

src/Job.php, line 269

Class

Job
Represents a job.

Namespace

Drupal\advancedqueue

Code

public function setState($state) {
  $this
    ->assertState($state);
  $this->state = $state;
  if ($state != self::STATE_PROCESSING) {
    $this->expires = 0;
  }
  return $this;
}