You are here

public function Job::cloneAsUnprocessed in Translation Management Tool 8

Clones job as unprocessed.

Overrides JobInterface::cloneAsUnprocessed

File

src/Entity/Job.php, line 250

Class

Job
Entity class for the tmgmt_job entity.

Namespace

Drupal\tmgmt\Entity

Code

public function cloneAsUnprocessed() {
  $clone = $this
    ->createDuplicate();
  $clone->uid->value = 0;
  $clone->reference->value = '';
  $clone->created->value = \Drupal::time()
    ->getRequestTime();
  $clone->state->value = Job::STATE_UNPROCESSED;
  return $clone;
}