public function ProductBundleItem::setQuantity in Commerce Product Bundle 8
Sets the quantity for the bundle item.
Parameters
float $quantity: The bundle item quantity.
Return value
\Drupal\commerce_product_bundle\Entity\BundleItemInterface The called product bundle item entity.
Overrides BundleItemInterface::setQuantity
File
- src/
Entity/ ProductBundleItem.php, line 240
Class
- ProductBundleItem
- Defines the product bundle item entity.
Namespace
Drupal\commerce_product_bundle\EntityCode
public function setQuantity($quantity) {
// @todo We need to check against the min/max constraints
// @see https://www.drupal.org/node/2847809
$this->activeQuantity = (double) $quantity;
return $this;
}