public function JobItem::cloneAsActive

File

src/Entity/JobItem.php, line 165

Class

JobItem
Entity class for the tmgmt_job_item entity.

Namespace

Drupal\tmgmt\Entity

Code

public function cloneAsActive() {
  $clone = $this
    ->createDuplicate();
  $clone->data->value = NULL;
  $clone->unserializedData = NULL;
  $clone->tjid->target_id = 0;
  $clone->tjiid->value = 0;
  $clone->word_count->value = NULL;
  $clone->tags_count->value = NULL;
  $clone->count_accepted->value = NULL;
  $clone->count_pending->value = NULL;
  $clone->count_translated->value = NULL;
  $clone->count_reviewed->value = NULL;
  $clone->file_count->value = NULL;
  $clone->state->value = static::STATE_ACTIVE;
  return $clone;
}