Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
BundleSelectionFactory.php
Go to the documentation of this file.
1 <?php
8 
10 
17 {
21  const SELECTION_CLASS_DEFAULT = \Magento\Bundle\Pricing\Price\BundleSelectionPrice::class;
22 
28  protected $objectManager;
29 
36  {
37  $this->objectManager = $objectManager;
38  }
39 
49  public function create(
51  Product $selection,
52  $quantity,
53  array $arguments = []
54  ) {
55  $arguments['bundleProduct'] = $bundleProduct;
56  $arguments['saleableItem'] = $selection;
57  $arguments['quantity'] = $quantity ? (float)$quantity : 1.;
58 
59  return $this->objectManager->create(self::SELECTION_CLASS_DEFAULT, $arguments);
60  }
61 }
create(Product $bundleProduct, Product $selection, $quantity, array $arguments=[])
$arguments
__construct(\Magento\Framework\ObjectManagerInterface $objectManager)
$bundleProduct