You are here

protected function RevisionOverviewController::buildDeleteRevisionLink in Entity API 8

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

Builds a link to delete an entity revision.

Parameters

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

Return value

array A link render array.

Overrides RevisionControllerTrait::buildDeleteRevisionLink

File

src/Controller/RevisionOverviewController.php, line 80

Class

RevisionOverviewController
Provides a controller which shows the revision history.

Namespace

Drupal\entity\Controller

Code

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