You are here

public function QuizResult::getQuiz in Quiz 8.6

Same name and namespace in other branches
  1. 8.5 src/Entity/QuizResult.php \Drupal\quiz\Entity\QuizResult::getQuiz()
  2. 6.x src/Entity/QuizResult.php \Drupal\quiz\Entity\QuizResult::getQuiz()

Get the Quiz of this result.

Return value

Quiz

2 calls to QuizResult::getQuiz()
QuizResult::label in src/Entity/QuizResult.php
Get the label for this quiz result.
QuizResult::maintainResults in src/Entity/QuizResult.php
Mark results as invalid for a quiz according to the keep results setting.

File

src/Entity/QuizResult.php, line 582

Class

QuizResult
Defines the Quiz entity class.

Namespace

Drupal\quiz\Entity

Code

public function getQuiz() {
  return Drupal::entityTypeManager()
    ->getStorage('quiz')
    ->loadRevision($this
    ->get('vid')
    ->getString());
}