You are here

public function ScheduledTransitionRouteProvider::getRoutes in Scheduled Transitions 8

Same name and namespace in other branches
  1. 2.x src/Routing/ScheduledTransitionRouteProvider.php \Drupal\scheduled_transitions\Routing\ScheduledTransitionRouteProvider::getRoutes()

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 DefaultHtmlRouteProvider::getRoutes

File

src/Routing/ScheduledTransitionRouteProvider.php, line 19

Class

ScheduledTransitionRouteProvider
Route provider for Scheduled Transition entities.

Namespace

Drupal\scheduled_transitions\Routing

Code

public function getRoutes(EntityTypeInterface $entity_type) {
  $collection = parent::getRoutes($entity_type);
  if ($route = $this
    ->getRescheduleFormRoute($entity_type)) {
    $collection
      ->add('entity.scheduled_transition.reschedule_form', $route);
  }
  return $collection;
}