You are here

protected function ShipmentRouteProvider::getCollectionRoute in Commerce Shipping 8.2

Gets the collection route.

Parameters

\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.

Return value

\Symfony\Component\Routing\Route|null The generated route, if available.

Overrides DefaultHtmlRouteProvider::getCollectionRoute

File

src/ShipmentRouteProvider.php, line 97

Class

ShipmentRouteProvider
Provides routes for the Shipment entity.

Namespace

Drupal\commerce_shipping

Code

protected function getCollectionRoute(EntityTypeInterface $entity_type) {
  $route = parent::getCollectionRoute($entity_type);
  if ($route) {
    $route
      ->setOption('parameters', [
      'commerce_order' => [
        'type' => 'entity:commerce_order',
      ],
    ]);
    $route
      ->setRequirement('_shipment_collection_access', 'TRUE');
  }
  return $route;
}