You are here

protected function RevisionOverviewController::buildRevertRevisionLink in Entity API 8

Same name and namespace in other branches
  1. 8.0 src/Controller/RevisionOverviewController.php \Drupal\entity\Controller\RevisionOverviewController::buildRevertRevisionLink()

Builds a link to revert an entity revision.

Parameters

\Drupal\Core\Entity\EntityInterface $entity_revision: The entity to build a revert revision link for.

Return value

array A link render array.

Overrides RevisionControllerTrait::buildRevertRevisionLink

File

src/Controller/RevisionOverviewController.php, line 68

Class

RevisionOverviewController
Provides a controller which shows the revision history.

Namespace

Drupal\entity\Controller

Code

protected function buildRevertRevisionLink(EntityInterface $entity_revision) {
  if ($entity_revision
    ->hasLinkTemplate('revision-revert-form')) {
    return [
      'title' => $this
        ->t('Revert'),
      'url' => $entity_revision
        ->toUrl('revision-revert-form'),
    ];
  }
}