VoucherPrice
extends BaseEntity
in package
AbstractYes
Voucher parameters per currency: min/max cart value (validation) + fixed discount `price` (null for a purely percentage voucher). PK = (voucher, currencyId), owned FK in the PK, `currencyId` is a scalar axis (like {@see ProductSetFeePrice}).
Tags
Attributes
- #[MappedSuperclass]
- #[TableAlias]
- $alias: 'voucherPrice'
Table of Contents
Properties
- $currencyId : int|null
- $maxPrice : string|null
- $minPrice : string
- $price : string|null
- $voucher : TVoucher|null
Methods
- __construct() : mixed
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getCurrencyId() : int|null
- getMaxPrice() : string|null
- getMinPrice() : string
- getPrice() : string|null
- getVoucher() : TVoucher|null
- setCurrencyId() : $this
- setMaxPrice() : $this
- setMinPrice() : $this
- setPrice() : $this
- setVoucher() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$currencyId
protected
int|null
$currencyId
= null
Attributes
- #[Column]
- $name: 'cms_system_currencies_currency_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[Id]
- #[Identity]
$maxPrice
protected
string|null
$maxPrice
= null
Attributes
- #[Column]
- $name: 'max_price'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $options: ['unsigned' => true]
- $nullable: true
$minPrice
protected
string
$minPrice
= '0.000'
Attributes
- #[Column]
- $name: 'min_price'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $options: ['unsigned' => true]
$price
protected
string|null
$price
= null
Attributes
- #[Column]
- $name: 'price'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $options: ['unsigned' => true]
- $nullable: true
$voucher
protected
TVoucher|null
$voucher
= null
Methods
__construct()
public
__construct([mixed $voucher = null ][, int|null $currencyId = null ][, string $minPrice = '0.000' ][, string|null $maxPrice = null ][, string|null $price = null ]) : mixed
Parameters
- $voucher : mixed = null
- $currencyId : int|null = null
- $minPrice : string = '0.000'
- $maxPrice : string|null = null
- $price : string|null = null
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getCurrencyId()
public
getCurrencyId() : int|null
Return values
int|nullgetMaxPrice()
public
getMaxPrice() : string|null
Return values
string|nullgetMinPrice()
public
getMinPrice() : string
Return values
stringgetPrice()
public
getPrice() : string|null
Return values
string|nullgetVoucher()
public
getVoucher() : TVoucher|null
Return values
TVoucher|nullsetCurrencyId()
public
setCurrencyId(int|null $currencyId) : $this
Parameters
- $currencyId : int|null
Return values
$thissetMaxPrice()
public
setMaxPrice(string|null $maxPrice) : $this
Parameters
- $maxPrice : string|null
Return values
$thissetMinPrice()
public
setMinPrice(string $minPrice) : $this
Parameters
- $minPrice : string
Return values
$thissetPrice()
public
setPrice(string|null $price) : $this
Parameters
- $price : string|null
Return values
$thissetVoucher()
public
setVoucher(TVoucher|null $voucher) : $this
Parameters
- $voucher : TVoucher|null
Return values
$thisgetTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>