Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. RevisionHtmlRouteProvider.php

function RevisionHtmlRouteProvider::getRoutes

Overrides EntityRouteProviderInterface::getRoutes

File

core/lib/Drupal/Core/Entity/Routing/RevisionHtmlRouteProvider.php, line 19

Class

RevisionHtmlRouteProvider
Provides entity revision routes.

Namespace

Drupal\Core\Entity\Routing

Code

public function getRoutes(EntityTypeInterface $entity_type) {
    $collection = new RouteCollection();
    $entityTypeId = $entity_type->id();
    if ($version_history_route = $this->getVersionHistoryRoute($entity_type)) {
        $collection->add("entity.{$entityTypeId}.version_history", $version_history_route);
    }
    if ($revision_view_route = $this->getRevisionViewRoute($entity_type)) {
        $collection->add("entity.{$entityTypeId}.revision", $revision_view_route);
    }
    if ($revision_revert_route = $this->getRevisionRevertRoute($entity_type)) {
        $collection->add("entity.{$entityTypeId}.revision_revert_form", $revision_revert_route);
    }
    if ($revision_delete_route = $this->getRevisionDeleteRoute($entity_type)) {
        $collection->add("entity.{$entityTypeId}.revision_delete_form", $revision_delete_route);
    }
    return $collection;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal