You are here

public function FieldCollectionItemController::revisionShow in Field collection 8

Same name and namespace in other branches
  1. 8.3 src/Controller/FieldCollectionItemController.php \Drupal\field_collection\Controller\FieldCollectionItemController::revisionShow()

Displays a field collection item revision.

Parameters

int $field_collection_item_revision: The field collection item revision ID.

Return value

array An array suitable for drupal_render().

1 string reference to 'FieldCollectionItemController::revisionShow'
field_collection.routing.yml in ./field_collection.routing.yml
field_collection.routing.yml

File

src/Controller/FieldCollectionItemController.php, line 118

Class

FieldCollectionItemController
Returns responses for Field collection item routes.

Namespace

Drupal\field_collection\Controller

Code

public function revisionShow($field_collection_item_revision) {
  $field_collection_item = $this
    ->entityTypeManager()
    ->getStorage('field_collection_item')
    ->loadRevision($field_collection_item_revision);
  $field_collection_item_view_controller = new EntityViewController($this
    ->entityManager(), \Drupal::service('renderer'));
  $page = $field_collection_item_view_controller
    ->view($field_collection_item);
  unset($page['field_collection_item'][$field_collection_item
    ->id()]['#cache']);
  return $page;
}