You are here

protected function SubscriptionRouteProvider::getCustomerEditFormRoute in Commerce Recurring Framework 8

Gets the customer-edit-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::getCustomerEditFormRoute()
SubscriptionRouteProvider::getRoutes in src/SubscriptionRouteProvider.php
Provides routes for entities.

File

src/SubscriptionRouteProvider.php, line 71

Class

SubscriptionRouteProvider
Provides routes for the Subscription entity.

Namespace

Drupal\commerce_recurring

Code

protected function getCustomerEditFormRoute(EntityTypeInterface $entity_type) {
  $route = new Route($entity_type
    ->getLinkTemplate('customer-edit-form'));
  $route
    ->addDefaults([
    '_entity_form' => 'commerce_subscription.customer',
    '_title_callback' => '\\Drupal\\Core\\Entity\\Controller\\EntityController::title',
  ])
    ->setRequirement('_entity_access', 'commerce_subscription.update')
    ->setRequirement('commerce_subscription', '\\d+')
    ->setOption('parameters', [
    'user' => [
      'type' => 'entity:user',
    ],
    'commerce_subscription' => [
      'type' => 'entity:commerce_subscription',
    ],
  ]);
  return $route;
}