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