Price
Price per cycle formatting helper
Properties summary
Type | Property | Description | |
---|---|---|---|
protected | $price |
Methods summary
Return Type | Method Name | Description | |
---|---|---|---|
Price | __construct(array $price) | Initialise price object | |
string | cycle() | Return billing cycle | |
bool | isFree() | Is the billing cycle one time? | |
bool | isOneTime() | Is the billing cycle one time? | |
bool | isRecurring() | Is the billing cycle recurring? | |
Price | setup() | Return setup fees | |
Price | price() | Return price | |
array | breakdown() | Return breakdown pricing info | |
string | toPrefixedString() | Format price as a prefixed currency string | |
string | toSuffixedString() | Format price as a suffixed string | |
string | toFullString() | Format price as a full currency string (prefix, amount and suffix) | |
string | getShortCycle() | Get short two-letter version of billing cycle | |
bool | isYearly() | Returns true if the price is a yearly price | |
string | cycleInYears() | Get billing cycle in year(s) | |
string | yearlyPrice() | Get per year price | |
string | cycleInMonths() | Get billing cycle in month(s) | |
string | monthlyPrice() | Get per month price | |
string | oneTimePrice() | Get one time price | |
string | breakdownPrice() | Get best available breakdown price | |
string | breakdownPriceNumeric() | Get best available breakdown price as a number | |
float | calculatePercentageDifference(float $price, int $decimalPlaces) deprecated | Calculate percentage difference between two prices. |
Details
Price
__construct (array $price)
Initialise price object
string
cycle ()
Return billing cycle
bool
isFree ()
Is the billing cycle one time?
bool
isOneTime ()
Is the billing cycle one time?
bool
isRecurring ()
Is the billing cycle recurring?
Price
setup ()
Return setup fees
Price
price ()
Return price
array
breakdown ()
Return breakdown pricing info
string
toPrefixedString ()
Format price as a prefixed currency string
string
toSuffixedString ()
Format price as a suffixed string
string
toFullString ()
Format price as a full currency string (prefix, amount and suffix)
string
getShortCycle ()
Get short two-letter version of billing cycle
bool
isYearly ()
Returns true if the price is a yearly price
string
cycleInYears ()
Get billing cycle in year(s)
string
yearlyPrice ()
Get per year price
string
cycleInMonths ()
Get billing cycle in month(s)
string
monthlyPrice ()
Get per month price
string
oneTimePrice ()
Get one time price
string
breakdownPrice ()
Get best available breakdown price
string
breakdownPriceNumeric ()
Get best available breakdown price as a number
float
calculatePercentageDifference (float $price, int $decimalPlaces)
deprecated
deprecated
Calculate percentage difference between two prices.
Will return the percentage discount from a given higher amount compared with the monthly amount from the current instantiated object.