protected function PriceListItemRouteProvider::getCollectionRoute in Commerce Pricelist 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/
PriceListItemRouteProvider.php, line 70
Class
- PriceListItemRouteProvider
- Provides routes for the price list item entity.
Namespace
Drupal\commerce_pricelistCode
protected function getCollectionRoute(EntityTypeInterface $entity_type) {
$route = parent::getCollectionRoute($entity_type);
$route
->setOption('parameters', [
'commerce_pricelist' => [
'type' => 'entity:commerce_pricelist',
],
]);
// AdminHtmlRouteProvider sets _admin_route for all routes except this one.
$route
->setOption('_admin_route', TRUE);
$route
->setDefault('_title_callback', PriceListController::class . '::priceListItemsTitle');
return $route;
}