Class CouponTerms
-
Model
-
AppModel
uses
Blesta\Core\Util\Common\Traits\Container
-
CouponTerms
Methods summary
public
|
#
__construct( )
Initialize Coupons
Overrides
|
public
integer
|
#
add( array $vars )
Creates a new coupon term
Creates a new coupon term
Parameters
- $vars
An array of coupon term information including:
- coupon_id The coupon ID this coupon term belongs to
- term The number of periods for this coupon term
- period The period for this coupon term
Returns
integer The ID for this coupon term
|
public
|
#
edit( integer $term_id, array $vars )
Edits a coupon term
Parameters
- $term_id
- The ID of the coupon term to update
- $vars
An array of coupon term information including:
- coupon_id The coupon ID this coupon term belongs to
- term The number of periods for this coupon term
- period The period for this coupon term
|
public
|
#
delete( integer $coupon_id, integer $term_id = null )
Permanently removes the coupon term from the system
Permanently removes the coupon term from the system
Parameters
- $coupon_id
- The ID of the coupon to delete terms for
- $term_id
- The ID of the coupon term to delete (optional)
|
public
The
|
#
get( integer $term_id, array $criteria = [] )
Gets the specified coupon term if it meets the given criteria
Gets the specified coupon term if it meets the given criteria
Parameters
- $term_id
- The ID of the coupon term to fetch
- $criteria
A list of criteria to filter by, including:
- coupon_id The coupon ID this coupon term belongs to
- term The number of periods for this coupon term
- period The period for this coupon term
Returns
The given coupon term, false on failure
|
public
|
#
getAll( array $criteria = [] )
Gets all coupon terms that meet the given criteria
Gets all coupon terms that meet the given criteria
Parameters
- $criteria
A list of criteria to filter by, including:
- coupon_id The coupon ID this coupon term belongs to
- term The number of periods for this coupon term
- period The period for this coupon term
|
public
array
|
#
getPeriods( )
Gets a list of valid periods for coupon terms
Gets a list of valid periods for coupon terms
Returns
array A list of valid periods and their language
|
Methods inherited from AppModel
_(),
boolToInt(),
currencyToDecimal(),
dateToUtc(),
errors(),
getPerPage(),
ifSet(),
loadCrypto(),
setDefaultIfEmpty(),
setPerPage(),
setRulesIfSet(),
strToBool(),
systemDecrypt(),
systemEncrypt(),
systemHash(),
truncateDecimal(),
validateExists(),
validateStateCountry()
|