GiftPrice
extends GiftPrice
in package
Cart value thresholds of a gift per currency: the gift is offered when the cart value lies in the interval [priceFrom, priceTo] (null = unbounded on that side). `price` is the informative value of the gift and does not enter any calculation.
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_eshop_gift_prices'
- #[TableAlias]
- 'giftPrice'
Table of Contents
Properties
- $currencyId : int|null
- $gift : Gift|null
- $price : string|null
- $priceFrom : string|null
- $priceTo : string|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
- getGift() : TGift|null
- getPrice() : string|null
- getPriceFrom() : string|null
- getPriceTo() : string|null
- setCurrencyId() : $this
- setGift() : $this
- setPrice() : $this
- setPriceFrom() : $this
- setPriceTo() : $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]
$gift
protected
Gift|null
$gift
= null
Attributes
- #[EntityOf]
- \App\UI\Admin\Eshop\Models\Entities\Gift::class
- #[Id]
- #[Identity]
- #[JoinColumn]
- $name: 'cms_mod_eshop_gifts_gift_id'
- $referencedColumnName: 'gift_id'
- $onDelete: 'CASCADE'
- #[ManyToOne]
- $targetEntity: \App\UI\Admin\Eshop\Models\Entities\Gift::class
- $inversedBy: 'prices'
$price
protected
string|null
$price
= null
Attributes
- #[Column]
- $name: 'price'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $options: ['unsigned' => true]
- $nullable: true
$priceFrom
protected
string|null
$priceFrom
= null
Attributes
- #[Column]
- $name: 'price_from'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $options: ['unsigned' => true]
- $nullable: true
$priceTo
protected
string|null
$priceTo
= null
Attributes
- #[Column]
- $name: 'price_to'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $options: ['unsigned' => true]
- $nullable: true
Methods
__construct()
public
__construct([mixed $gift = null ][, int|null $currencyId = null ][, string|null $priceFrom = null ][, string|null $priceTo = null ][, string|null $price = null ]) : mixed
Parameters
- $gift : mixed = null
- $currencyId : int|null = null
- $priceFrom : string|null = null
- $priceTo : 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|nullgetGift()
public
getGift() : TGift|null
Return values
TGift|nullgetPrice()
public
getPrice() : string|null
Return values
string|nullgetPriceFrom()
public
getPriceFrom() : string|null
Return values
string|nullgetPriceTo()
public
getPriceTo() : string|null
Return values
string|nullsetCurrencyId()
public
setCurrencyId(int|null $currencyId) : $this
Parameters
- $currencyId : int|null
Return values
$thissetGift()
public
setGift(TGift|null $gift) : $this
Parameters
- $gift : TGift|null
Return values
$thissetPrice()
public
setPrice(string|null $price) : $this
Parameters
- $price : string|null
Return values
$thissetPriceFrom()
public
setPriceFrom(string|null $priceFrom) : $this
Parameters
- $priceFrom : string|null
Return values
$thissetPriceTo()
public
setPriceTo(string|null $priceTo) : $this
Parameters
- $priceTo : string|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>