public function BundleItemInterface::setCurrentVariation in Commerce Product Bundle 8
Gets the currently selected variation, or the default variation.
Parameters
\Drupal\commerce_product\Entity\ProductVariationInterface $variation: The variation.
Return value
$this
Throws
\InvalidArgumentException In case the variation passed as argument is not referenced by the bundle item.
1 method overrides BundleItemInterface::setCurrentVariation()
- ProductBundleItem::setCurrentVariation in src/
Entity/ ProductBundleItem.php - Gets the currently selected variation, or the default variation.
File
- src/
Entity/ BundleItemInterface.php, line 298
Class
- BundleItemInterface
- Provides an interface for defining product bundle item entities.
Namespace
Drupal\commerce_product_bundle\EntityCode
public function setCurrentVariation(ProductVariationInterface $variation);