You are here

public function ProductVariationController::deleteTitle in Commerce Core 8.2

Provides the delete title callback for product variations.

Parameters

\Drupal\Core\Routing\RouteMatchInterface $route_match: The route match.

Return value

string The title for the product variation delete page.

File

modules/product/src/Controller/ProductVariationController.php, line 84

Class

ProductVariationController
Provides title callbacks for product variation routes.

Namespace

Drupal\commerce_product\Controller

Code

public function deleteTitle(RouteMatchInterface $route_match) {
  $product_variation = $route_match
    ->getParameter('commerce_product_variation');
  $product_variation = $this->entityRepository
    ->getTranslationFromContext($product_variation);
  return $this
    ->t('Delete %label', [
    '%label' => $product_variation
      ->label(),
  ]);
}