public function PriceListItemRouteProvider::getRoutes in Commerce Pricelist 8.2
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 AdminHtmlRouteProvider::getRoutes
File
- src/
PriceListItemRouteProvider.php, line 20
Class
- PriceListItemRouteProvider
- Provides routes for the price list item entity.
Namespace
Drupal\commerce_pricelistCode
public function getRoutes(EntityTypeInterface $entity_type) {
$collection = parent::getRoutes($entity_type);
$entity_type_id = $entity_type
->id();
if ($export_route = $this
->getExportFormRoute($entity_type)) {
$collection
->add("entity.{$entity_type_id}.export_form", $export_route);
}
if ($import_route = $this
->getImportFormRoute($entity_type)) {
$collection
->add("entity.{$entity_type_id}.import_form", $import_route);
}
return $collection;
}