You are here

public function WishlistRouteProvider::getRoutes in Commerce Wishlist 8.3

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

File

src/WishlistRouteProvider.php, line 19

Class

WishlistRouteProvider
Provides routes for the wishlist entity.

Namespace

Drupal\commerce_wishlist

Code

public function getRoutes(EntityTypeInterface $entity_type) {
  $collection = parent::getRoutes($entity_type);
  if ($share_form_route = $this
    ->getShareFormRoute($entity_type)) {
    $collection
      ->add('entity.commerce_wishlist.share_form', $share_form_route);
  }
  if ($user_form_route = $this
    ->getUserFormRoute($entity_type)) {
    $collection
      ->add('entity.commerce_wishlist.user_form', $user_form_route);
  }
  return $collection;
}