You are here

function Quiz::createDuplicate in Quiz 6.x

Same name and namespace in other branches
  1. 8.6 src/Entity/Quiz.php \Drupal\quiz\Entity\Quiz::createDuplicate()
  2. 8.5 src/Entity/Quiz.php \Drupal\quiz\Entity\Quiz::createDuplicate()

Store old revision ID for copying questions.

Overrides ContentEntityBase::createDuplicate

File

src/Entity/Quiz.php, line 757

Class

Quiz
Defines the Quiz entity class.

Namespace

Drupal\quiz\Entity

Code

function createDuplicate() {
  $vid = $this
    ->getRevisionId();
  $dupe = parent::createDuplicate();
  $dupe->old_vid = $vid;
  return $dupe;
}