You are here

public function QuizResult::toUrl in Quiz 8.6

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

Quiz results are never viewed outside of a Quiz, so we enforce that a Quiz route parameter is added.

Overrides EntityBase::toUrl

File

src/Entity/QuizResult.php, line 571

Class

QuizResult
Defines the Quiz entity class.

Namespace

Drupal\quiz\Entity

Code

public function toUrl($rel = 'canonical', array $options = array()) {
  $url = parent::toUrl($rel, $options);
  $url
    ->setRouteParameter('quiz', $this
    ->get('qid')
    ->getString());
  return $url;
}