CoolCMS API

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
extends
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

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>

getFreeFromAsFloat()

public getFreeFromAsFloat() : float|null
Return values
float|null

getTariff()

public getTariff() : TShipperTariff|null
Return values
TShipperTariff|null

getWeightFromAsFloat()

public getWeightFromAsFloat() : float
Return values
float

getWeightToAsFloat()

public getWeightToAsFloat() : float|null
Return values
float|null

setActive()

public setActive(bool $active) : $this
Parameters
$active : bool
Return values
$this

setCurrencyId()

public setCurrencyId(int|null $currencyId) : $this
Parameters
$currencyId : int|null
Return values
$this

setDateFrom()

public setDateFrom(DateTime|null $dateFrom) : $this
Parameters
$dateFrom : DateTime|null
Return values
$this

setFreeFrom()

public setFreeFrom(string|null $freeFrom) : $this
Parameters
$freeFrom : string|null
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setPrice()

public setPrice(string $price) : $this
Parameters
$price : string
Return values
$this

setTariff()

public setTariff(TShipperTariff|null $tariff) : $this
Parameters
$tariff : TShipperTariff|null
Return values
$this

setVat()

public setVat(TVat|null $vat) : $this
Parameters
$vat : TVat|null
Return values
$this

setWeightFrom()

public setWeightFrom(string $weightFrom) : $this
Parameters
$weightFrom : string
Return values
$this

setWeightTo()

public setWeightTo(string|null $weightTo) : $this
Parameters
$weightTo : string|null
Return values
$this

getTraitsRecursive()

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>
Return values
array<string, string>
On this page

Search results