You are here

public function ProductVariation::getArgument in Commerce Core 8.2

Return the default argument.

This needs to be overridden by every default argument handler to properly do what is needed.

Overrides ArgumentDefaultPluginBase::getArgument

File

modules/product/src/Plugin/views/argument_default/ProductVariation.php, line 62

Class

ProductVariation
Default argument plugin to extract a product variation.

Namespace

Drupal\commerce_product\Plugin\views\argument_default

Code

public function getArgument() {
  if (($variation = $this->routeMatch
    ->getParameter('commerce_product_variation')) && $variation instanceof ProductVariationInterface) {
    return $variation
      ->id();
  }
}