protected function ProductVariationRouteProvider::getEditFormRoute in Commerce Core 8.2
Gets the edit-form 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::getEditFormRoute
File
- modules/
product/ src/ ProductVariationRouteProvider.php, line 42
Class
- ProductVariationRouteProvider
- Provides routes for the product variation entity.
Namespace
Drupal\commerce_productCode
protected function getEditFormRoute(EntityTypeInterface $entity_type) {
$route = parent::getEditFormRoute($entity_type);
$route
->setDefault('_title_callback', ProductVariationController::class . '::editTitle');
$route
->setOption('parameters', [
'commerce_product' => [
'type' => 'entity:commerce_product',
],
'commerce_product_variation' => [
'type' => 'entity:commerce_product_variation',
],
]);
$route
->setOption('_admin_route', TRUE);
return $route;
}