protected function WishlistRouteProvider::getUserFormRoute in Commerce Wishlist 8.3
Gets the user-form route.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.
Return value
\Symfony\Component\Routing\Route|null The generated route, if available.
1 call to WishlistRouteProvider::getUserFormRoute()
- WishlistRouteProvider::getRoutes in src/
WishlistRouteProvider.php - Provides routes for entities.
File
- src/
WishlistRouteProvider.php, line 80
Class
- WishlistRouteProvider
- Provides routes for the wishlist entity.
Namespace
Drupal\commerce_wishlistCode
protected function getUserFormRoute(EntityTypeInterface $entity_type) {
$route = new Route($entity_type
->getLinkTemplate('user-form'));
$route
->addDefaults([
'_controller' => WishlistController::class . '::userForm',
'_title' => 'Wishlist',
])
->setRequirement('_custom_access', WishlistUserAccessCheck::class . '::checkAccess')
->setOption('parameters', [
'user' => [
'type' => 'entity:user',
],
]);
return $route;
}