You are here

protected function PriceListRouteProvider::getAddFormRoute in Commerce Pricelist 8.2

Gets the add-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::getAddFormRoute

File

src/PriceListRouteProvider.php, line 17

Class

PriceListRouteProvider
Provides routes for the price list entity.

Namespace

Drupal\commerce_pricelist

Code

protected function getAddFormRoute(EntityTypeInterface $entity_type) {
  $route = parent::getAddFormRoute($entity_type);

  // Use addTitle instead of addBundleTitle because "Add product variation"
  // sounds more confusing than "Add price list".
  $route
    ->setDefault('_title_callback', EntityController::class . '::addTitle');
  return $route;
}