protected function PriceListItemRouteProvider::getExportFormRoute in Commerce Pricelist 8.2
Gets the export-form route.
Parameters
\Drupal\Core\Entity\EntityTypeInterface $entity_type: The entity type.
Return value
\Symfony\Component\Routing\Route|null The generated route, if available.
1 call to PriceListItemRouteProvider::getExportFormRoute()
- PriceListItemRouteProvider::getRoutes in src/
PriceListItemRouteProvider.php - Provides routes for entities.
File
- src/
PriceListItemRouteProvider.php, line 93
Class
- PriceListItemRouteProvider
- Provides routes for the price list item entity.
Namespace
Drupal\commerce_pricelistCode
protected function getExportFormRoute(EntityTypeInterface $entity_type) {
if ($entity_type
->hasLinkTemplate('export-form')) {
$route = new Route($entity_type
->getLinkTemplate('export-form'));
$route
->setDefaults([
'_form' => PriceListItemExportForm::class,
'_title' => 'Export prices',
])
->setRequirement('_permission', $entity_type
->getAdminPermission())
->setRequirement('commerce_pricelist', '\\d+')
->setOption('parameters', [
'commerce_pricelist' => [
'type' => 'entity:commerce_pricelist',
],
])
->setOption('_admin_route', TRUE);
return $route;
}
}