You are here

public function Product::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/Product.php, line 62

Class

Product
Default argument plugin to extract a product.

Namespace

Drupal\commerce_product\Plugin\views\argument_default

Code

public function getArgument() {
  if (($product = $this->routeMatch
    ->getParameter('commerce_product')) && $product instanceof ProductInterface) {
    return $product
      ->id();
  }
}