class Percent implements CouponTypeInterface

A Percent object only requires the percentage.

Properties

protected $percentage
protected $currency

Methods

__construct(int $percentage, string $currency = 'usd')

Create a percent object with currency.

array
toArray()

Return an associative array with the values of the properties.

Details

at line 25
__construct(int $percentage, string $currency = 'usd')

Create a percent object with currency.

The percentage must be a int greater than 0 and less than 100.

Parameters

int $percentage
string $currency

Exceptions

InvalidArgumentException

at line 40
array toArray()

Return an associative array with the values of the properties.

Return Value

array