You are here

protected function RouteSubscriber::getEntityLoadRoute in Workflow 8

Gets the entity load route.

Parameters

string $entityTypeId: The entity type id.

string $path: The Path of the route.

Return value

\Symfony\Component\Routing\Route|null The generated route, if available.

1 call to RouteSubscriber::getEntityLoadRoute()
RouteSubscriber::alterRoutes in src/Routing/RouteSubscriber.php
Alters existing routes for a specific collection.

File

src/Routing/RouteSubscriber.php, line 75

Class

RouteSubscriber
Subscriber for Workflow routes.

Namespace

Drupal\workflow\Routing

Code

protected function getEntityLoadRoute($entityTypeId, $path) {

  /*
   * @todo Create the Route for taxonomy term like
   * '/taxonomy/term/{taxonomy_term}/workflow/{field_name}'
   *
   */
  $route = new Route($path, [
    '_controller' => '\\Drupal\\workflow\\Controller\\WorkflowTransitionListController::historyOverview',
    '_title' => 'Workflow history',
  ], [
    '_custom_access' => '\\Drupal\\workflow\\Access\\WorkflowHistoryAccess::access',
  ], [
    '_admin_route' => TRUE,
    '_workflow_entity_type_id' => $entityTypeId,
    // @todo Remove this.
    'parameters' => [
      $entityTypeId => [
        'type' => 'entity:' . $entityTypeId,
      ],
    ],
  ]);
  return $route;
}