ShipperTariffPrice
extends ShipperTariffPrice
in package
Tariff price: an append-only time series per weight interval × currency × validity date (`dateFrom`). Unlike {@see ProductSetFeePrice}/{@see ProductSetPrice} (composite PK without surrogate id, where `publishedTime` must be ORM `type: 'string'`), this entity keeps a surrogate auto-increment `id`, so `dateFrom` is not part of the Doctrine identifier and is a normal `type: 'datetime'` column. The property is `\DateTime`, not `\DateTimeImmutable`: the DBAL `datetime` type accepts only `\DateTime` (the immutable one needs `datetime_immutable`).
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_eshop_shipper_tariff_prices'
- #[TableAlias]
- 'shipperTariffPrice'
Table of Contents
Properties
- $active : bool
- $currencyId : int|null
- $dateFrom : DateTime|null
- $freeFrom : string|null
- $id : int|null
- $price : string
- $tariff : TShipperTariff|null
- $vat : TVat|null
- $weightFrom : string
- $weightTo : string|null
Methods
- __construct() : mixed
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getActive() : bool
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getCurrencyId() : int|null
- getDateFrom() : DateTime|null
- getFreeFrom() : string|null
- getFreeFromAsFloat() : float|null
- getId() : int|null
- getPrice() : string
- getPriceAsFloat() : float
- getTariff() : TShipperTariff|null
- getVat() : TVat|null
- getWeightFrom() : string
- getWeightFromAsFloat() : float
- getWeightTo() : string|null
- getWeightToAsFloat() : float|null
- isActive() : bool
- isPersisted() : bool
- setActive() : $this
- setCurrencyId() : $this
- setDateFrom() : $this
- setFreeFrom() : $this
- setId() : $this
- setPrice() : $this
- setTariff() : $this
- setVat() : $this
- setWeightFrom() : $this
- setWeightTo() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$active
protected
bool
$active
= true
Attributes
- #[Column]
- $name: 'active'
- $type: 'boolean'
- $options: ['default' => true]
$currencyId
protected
int|null
$currencyId
= null
Attributes
- #[Column]
- $name: 'cms_system_currencies_currency_id'
- $type: 'integer'
- $options: ['unsigned' => true]
$dateFrom
protected
DateTime|null
$dateFrom
= null
Attributes
- #[Column]
- $name: 'date_from'
- $type: 'datetime'
$freeFrom
protected
string|null
$freeFrom
= null
Attributes
- #[Column]
- $name: 'free_from'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $nullable: true
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'shipper_tariff_price_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$price
protected
string
$price
= '0.000'
Attributes
- #[Column]
- $name: 'price'
- $type: 'decimal'
- $precision: 10
- $scale: 3
$tariff
protected
TShipperTariff|null
$tariff
= null
Attributes
- #[EntityOf]
- \App\UI\Admin\Eshop\Models\Entities\ShipperTariff::class
- #[JoinColumn]
- $name: 'cms_mod_eshop_shipper_tariffs_shipper_tariff_id'
- $referencedColumnName: 'shipper_tariff_id'
- $nullable: false
- $onDelete: 'CASCADE'
- #[ManyToOne]
- $targetEntity: \App\UI\Admin\Eshop\Models\Entities\ShipperTariff::class
- $inversedBy: 'prices'
$vat
protected
TVat|null
$vat
= null
Attributes
- #[EntityOf]
- \App\UI\Admin\System\Models\Entities\Vat::class
- #[JoinColumn]
- $name: 'cms_system_vats_vat_id'
- $referencedColumnName: 'vat_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Admin\System\Models\Entities\Vat::class
- $fetch: 'LAZY'
$weightFrom
protected
string
$weightFrom
= '0.000'
Attributes
- #[Column]
- $name: 'weight_from'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $options: ['unsigned' => true]
$weightTo
protected
string|null
$weightTo
= null
Attributes
- #[Column]
- $name: 'weight_to'
- $type: 'decimal'
- $precision: 10
- $scale: 3
- $nullable: true
- $options: ['unsigned' => true]
Methods
__construct()
public
__construct([int|null $id = null ][, mixed $tariff = null ][, int|null $currencyId = null ][, mixed $vat = null ][, DateTime|null $dateFrom = null ][, string $weightFrom = '0.000' ][, string|null $weightTo = null ][, string $price = '0.000' ][, bool $active = true ][, string|null $freeFrom = null ]) : mixed
Parameters
- $id : int|null = null
- $tariff : mixed = null
- $currencyId : int|null = null
- $vat : mixed = null
- $dateFrom : DateTime|null = null
- $weightFrom : string = '0.000'
- $weightTo : string|null = null
- $price : string = '0.000'
- $active : bool = true
- $freeFrom : string|null = null
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getActive()
public
getActive() : bool
Return values
boolgetAllTraits()
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|nullgetDateFrom()
public
getDateFrom() : DateTime|null
Return values
DateTime|nullgetFreeFrom()
public
getFreeFrom() : string|null
Return values
string|nullgetFreeFromAsFloat()
public
getFreeFromAsFloat() : float|null
Return values
float|nullgetId()
public
getId() : int|null
Return values
int|nullgetPrice()
public
getPrice() : string
Return values
stringgetPriceAsFloat()
public
getPriceAsFloat() : float
Return values
floatgetTariff()
public
getTariff() : TShipperTariff|null
Return values
TShipperTariff|nullgetVat()
public
getVat() : TVat|null
Return values
TVat|nullgetWeightFrom()
public
getWeightFrom() : string
Return values
stringgetWeightFromAsFloat()
public
getWeightFromAsFloat() : float
Return values
floatgetWeightTo()
public
getWeightTo() : string|null
Return values
string|nullgetWeightToAsFloat()
public
getWeightToAsFloat() : float|null
Return values
float|nullisActive()
public
isActive() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolsetActive()
public
setActive(bool $active) : $this
Parameters
- $active : bool
Return values
$thissetCurrencyId()
public
setCurrencyId(int|null $currencyId) : $this
Parameters
- $currencyId : int|null
Return values
$thissetDateFrom()
public
setDateFrom(DateTime|null $dateFrom) : $this
Parameters
- $dateFrom : DateTime|null
Return values
$thissetFreeFrom()
public
setFreeFrom(string|null $freeFrom) : $this
Parameters
- $freeFrom : string|null
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetPrice()
public
setPrice(string $price) : $this
Parameters
- $price : string
Return values
$thissetTariff()
public
setTariff(TShipperTariff|null $tariff) : $this
Parameters
- $tariff : TShipperTariff|null
Return values
$thissetVat()
public
setVat(TVat|null $vat) : $this
Parameters
- $vat : TVat|null
Return values
$thissetWeightFrom()
public
setWeightFrom(string $weightFrom) : $this
Parameters
- $weightFrom : string
Return values
$thissetWeightTo()
public
setWeightTo(string|null $weightTo) : $this
Parameters
- $weightTo : 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>