You are here

protected function WishlistRouteProvider::getCanonicalRoute in Commerce Wishlist 8.3

Gets the canonical route.

Parameters

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

Return value

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

Overrides DefaultHtmlRouteProvider::getCanonicalRoute

File

src/WishlistRouteProvider.php, line 35

Class

WishlistRouteProvider
Provides routes for the wishlist entity.

Namespace

Drupal\commerce_wishlist

Code

protected function getCanonicalRoute(EntityTypeInterface $entity_type) {
  $route = new Route('/wishlist/{code}');
  $route
    ->addDefaults([
    '_controller' => WishlistController::class . '::userForm',
    '_title' => 'Wishlist',
  ])
    ->setRequirement('_access', 'TRUE');
  return $route;
}