Composite price model
Definition at line 15 of file PriceComposite.php.
◆ __construct()
__construct |
( |
PriceFactory |
$priceFactory, |
|
|
array |
$metadata = [] |
|
) |
| |
- Parameters
-
PriceFactory | $priceFactory | |
array | $metadata | |
Definition at line 31 of file PriceComposite.php.
◆ createPriceObject()
- Parameters
-
- Returns
- PriceInterface
- Exceptions
-
Definition at line 62 of file PriceComposite.php.
64 if (!isset($this->metadata[$priceCode])) {
65 throw new \InvalidArgumentException($priceCode .
' is not registered in prices list');
67 $className = $this->metadata[$priceCode][
'class'];
68 return $this->priceFactory->create($salableItem,
$className, $quantity);
◆ getMetadata()
◆ getPriceCodes()
- Returns
- array
Definition at line 40 of file PriceComposite.php.
42 return array_keys($this->metadata);
◆ $metadata
◆ $priceFactory
The documentation for this class was generated from the following file: