protected function SubscriptionRouteProvider::getCustomerViewRoute in Commerce Recurring Framework 8
Gets the customer-view route.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.
Return value
\Symfony\Component\Routing\Route The generated route.
1 call to SubscriptionRouteProvider::getCustomerViewRoute()
- SubscriptionRouteProvider::getRoutes in src/
SubscriptionRouteProvider.php - Provides routes for entities.
File
- src/
SubscriptionRouteProvider.php, line 101
Class
- SubscriptionRouteProvider
- Provides routes for the Subscription entity.
Namespace
Drupal\commerce_recurringCode
protected function getCustomerViewRoute(EntityTypeInterface $entity_type) {
$route = new Route($entity_type
->getLinkTemplate('customer-view'));
$route
->addDefaults([
'_entity_view' => 'commerce_subscription.customer',
'_title_callback' => '\\Drupal\\Core\\Entity\\Controller\\EntityController::title',
])
->setRequirement('_entity_access', 'commerce_subscription.view')
->setRequirement('commerce_subscription', '\\d+')
->setOption('parameters', [
'user' => [
'type' => 'entity:user',
],
'commerce_subscription' => [
'type' => 'entity:commerce_subscription',
],
]);
return $route;
}