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

__construct(Product $product)

Create a new price instance.

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.

Parameters

Product $product

at line 80
abstract int amount()

Get the price amount.

Return Value

int

at line 87
abstract string unit()

Get the price unit.

Return Value

string

at line 94
int total()

Add commission to the amount.

Return Value

int

at line 107
protected string baseUnit(string $unit)

Fetch the base for the given unit.

Parameters

string $unit

Return Value

string

at line 118
protected int factor(string $unit)

Fetch the factor for the given unit.

Parameters

string $unit

Return Value

int

at line 128
protected mixed config(string $unit, string $key)

Get the units config and store it on the object.

Parameters

string $unit
string $key

Return Value

mixed