You are here

public function DiffRouteProvider::getRoutes in Diff 8

Provides routes for entities.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type

Return value

\Symfony\Component\Routing\RouteCollection|\Symfony\Component\Routing\Route[] Returns a route collection or an array of routes keyed by name, like route_callbacks inside 'routing.yml' files.

Overrides EntityRouteProviderInterface::getRoutes

File

src/Routing/DiffRouteProvider.php, line 18

Class

DiffRouteProvider
Contains routes for diff functionality.

Namespace

Drupal\diff\Routing

Code

public function getRoutes(EntityTypeInterface $entity_type) {
  $collection = new RouteCollection();
  if ($route = $this
    ->getDiffRoute($entity_type)) {
    $collection
      ->add('entity.' . $entity_type
      ->id() . '.revisions_diff', $route);
  }
  return $collection;
}