You are here

public function SubscriptionRouteProvider::getRoutes in Commerce Recurring Framework 8

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

File

src/SubscriptionRouteProvider.php, line 17

Class

SubscriptionRouteProvider
Provides routes for the Subscription entity.

Namespace

Drupal\commerce_recurring

Code

public function getRoutes(EntityTypeInterface $entity_type) {
  $collection = parent::getRoutes($entity_type);
  if ($cancel_form_route = $this
    ->getCancelFormRoute($entity_type)) {
    $collection
      ->add('entity.commerce_subscription.cancel_form', $cancel_form_route);
  }
  if ($customer_view_route = $this
    ->getCustomerViewRoute($entity_type)) {
    $collection
      ->add('entity.commerce_subscription.customer_view', $customer_view_route);
  }
  if ($customer_edit_form_route = $this
    ->getCustomerEditFormRoute($entity_type)) {
    $collection
      ->add('entity.commerce_subscription.customer_edit_form', $customer_edit_form_route);
  }
  return $collection;
}