You are here

public function OpignoAnswerController::revisionShow in Opigno module 8

Same name and namespace in other branches
  1. 3.x src/Controller/OpignoAnswerController.php \Drupal\opigno_module\Controller\OpignoAnswerController::revisionShow()

Displays a Answer revision.

Parameters

int $opigno_answer_revision: The Answer revision ID.

Return value

array An array suitable for drupal_render().

Throws

\Drupal\Component\Plugin\Exception\InvalidPluginDefinitionException

\Drupal\Component\Plugin\Exception\PluginNotFoundException

File

src/Controller/OpignoAnswerController.php, line 33

Class

OpignoAnswerController
Class OpignoAnswerController.

Namespace

Drupal\opigno_module\Controller

Code

public function revisionShow($opigno_answer_revision) {
  $opigno_answer = $this
    ->entityTypeManager()
    ->getStorage('opigno_answer')
    ->loadRevision($opigno_answer_revision);
  $view_builder = $this
    ->entityTypeManager()
    ->getViewBuilder('opigno_answer');
  return $view_builder
    ->view($opigno_answer);
}