Price
abstract class Price
Properties
| protected array | $config | The unit configurations. | |
| protected string | $unit | The products unit. | |
| protected int | $volume | The products volume. | |
| protected string | $volumeUnit | The products volume unit. | |
| protected int | $price | The products price. | |
| protected string | $priceUnit | The products price unit. | |
| protected Product | $product | The product. |
Methods
int
amount()
Get the price amount.
string
unit()
Get the price unit.
int
total()
Add commission to the amount.
string
baseUnit(string $unit)
Fetch the base for the given unit.
int
factor(string $unit)
Fetch the factor for the given unit.
mixed
config(string $unit, string $key)
Get the units config and store it on the object.
Details
at line 65
__construct(Product $product)
Create a new price instance.
at line 80
abstract int
amount()
Get the price amount.
at line 87
abstract string
unit()
Get the price unit.
at line 94
int
total()
Add commission to the amount.
at line 107
protected string
baseUnit(string $unit)
Fetch the base for the given unit.
at line 118
protected int
factor(string $unit)
Fetch the factor for the given unit.
at line 128
protected mixed
config(string $unit, string $key)
Get the units config and store it on the object.