OrderShipper
extends OrderShipper
in package
1:1 snapshot of the order's shipping (PK = order; owned FK in the PK). `price` is without VAT plus the rate (shipping is entered without VAT), `priceWithVat` is computed by `OrderCalculator`. Shipper and tariff are references only (`SET NULL`), so the snapshot survives deleting the code list.
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_eshop_order_shippers'
- #[TableAlias]
- 'orderShipper'
Table of Contents
Properties
- $name : string
- $order : Order|null
- $pickupCarrier : string|null
- $pickupPointCity : string|null
- $pickupPointCode : string|null
- $pickupPointCountry : string|null
- $pickupPointData : string|null
- $pickupPointName : string|null
- $pickupPointStreet : string|null
- $pickupPointZip : string|null
- $price : string
- $priceWithVat : string
- $shipper : TShipper|null
- $tariff : TTariff|null
- $vat : string
Methods
- __construct() : mixed
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- clearPickupPoint() : void
- Clears all `pickup*` fields. Called when the tariff or shipper of an existing snapshot changes ({@see \App\UI\Api\Eshop\Models\Services\OrderSnapshotBuilder::buildShipper()} and `buildShipperFromRow()`) or when the applier finds that the new tariff does not require `external_pickup` ({@see \App\UI\Api\Eshop\Models\Services\OrderPickupPointApplier::apply()}). A pickup point belongs to one tariff/shipper; without clearing, the snapshot would keep the code and address of the original tariff's point after a switch.
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getName() : string
- getOrder() : TOrder|null
- getPickupCarrier() : string|null
- getPickupPointCity() : string|null
- getPickupPointCode() : string|null
- getPickupPointCountry() : string|null
- getPickupPointData() : string|null
- getPickupPointName() : string|null
- getPickupPointStreet() : string|null
- getPickupPointZip() : string|null
- getPrice() : string
- getPriceWithVat() : string
- getShipper() : TShipper|null
- getTariff() : TTariff|null
- getVat() : string
- getVatAsFloat() : float
- setName() : $this
- setOrder() : $this
- setPickupCarrier() : $this
- setPickupPointCity() : $this
- setPickupPointCode() : $this
- setPickupPointCountry() : $this
- setPickupPointData() : $this
- setPickupPointName() : $this
- setPickupPointStreet() : $this
- setPickupPointZip() : $this
- setPrice() : $this
- setPriceWithVat() : $this
- setShipper() : $this
- setTariff() : $this
- setVat() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$name
protected
string
$name
= ''
Attributes
- #[Column]
- $name: 'name'
- $type: 'string'
- $length: 255
$order
protected
Order|null
$order
= null
Attributes
- #[Id]
- #[JoinColumn]
- $name: 'cms_mod_eshop_orders_order_id'
- $referencedColumnName: 'order_id'
- $onDelete: 'CASCADE'
- #[OneToOne]
- $targetEntity: \App\UI\Admin\Eshop\Models\Entities\Order::class
- $inversedBy: 'shipper'
- #[ParentRef]
$pickupCarrier
protected
string|null
$pickupCarrier
= null
Attributes
- #[Column]
- $name: 'pickup_carrier'
- $type: 'string'
- $length: 45
- $nullable: true
$pickupPointCity
protected
string|null
$pickupPointCity
= null
Attributes
- #[Column]
- $name: 'pickup_point_city'
- $type: 'string'
- $length: 100
- $nullable: true
$pickupPointCode
protected
string|null
$pickupPointCode
= null
Attributes
- #[Column]
- $name: 'pickup_point_code'
- $type: 'string'
- $length: 64
- $nullable: true
$pickupPointCountry
protected
string|null
$pickupPointCountry
= null
Attributes
- #[Column]
- $name: 'pickup_point_country'
- $type: 'string'
- $length: 60
- $nullable: true
$pickupPointData
protected
string|null
$pickupPointData
= null
Attributes
- #[Column]
- $name: 'pickup_point_data'
- $type: 'text'
- $nullable: true
$pickupPointName
protected
string|null
$pickupPointName
= null
Attributes
- #[Column]
- $name: 'pickup_point_name'
- $type: 'string'
- $length: 255
- $nullable: true
$pickupPointStreet
protected
string|null
$pickupPointStreet
= null
Attributes
- #[Column]
- $name: 'pickup_point_street'
- $type: 'string'
- $length: 100
- $nullable: true
$pickupPointZip
protected
string|null
$pickupPointZip
= null
Attributes
- #[Column]
- $name: 'pickup_point_zip'
- $type: 'string'
- $length: 10
- $nullable: true
$price
protected
string
$price
= '0.000'
Attributes
- #[Column]
- $name: 'price'
- $type: 'decimal'
- $precision: 10
- $scale: 3
$priceWithVat
protected
string
$priceWithVat
= '0.000'
Attributes
- #[Column]
- $name: 'price_with_vat'
- $type: 'decimal'
- $precision: 10
- $scale: 3
$shipper
protected
TShipper|null
$shipper
= null
Attributes
- #[EntityOf]
- \App\UI\Admin\Eshop\Models\Entities\Shipper::class
- #[JoinColumn]
- $name: 'cms_mod_eshop_shippers_shipper_id'
- $referencedColumnName: 'shipper_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Admin\Eshop\Models\Entities\Shipper::class
- $fetch: 'LAZY'
$tariff
protected
TTariff|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: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Admin\Eshop\Models\Entities\ShipperTariff::class
- $fetch: 'LAZY'
$vat
protected
string
$vat
= '0.00'
Attributes
- #[Column]
- $name: 'vat'
- $type: 'decimal'
- $precision: 5
- $scale: 2
Methods
__construct()
public
__construct([mixed $order = null ][, mixed $shipper = null ][, mixed $tariff = null ][, string $name = '' ][, string $price = '0.000' ][, string $priceWithVat = '0.000' ][, string $vat = '0.00' ][, string|null $pickupCarrier = null ][, string|null $pickupPointCode = null ][, string|null $pickupPointName = null ][, string|null $pickupPointStreet = null ][, string|null $pickupPointCity = null ][, string|null $pickupPointZip = null ][, string|null $pickupPointCountry = null ][, string|null $pickupPointData = null ]) : mixed
Parameters
- $order : mixed = null
- $shipper : mixed = null
- $tariff : mixed = null
- $name : string = ''
- $price : string = '0.000'
- $priceWithVat : string = '0.000'
- $vat : string = '0.00'
- $pickupCarrier : string|null = null
- $pickupPointCode : string|null = null
- $pickupPointName : string|null = null
- $pickupPointStreet : string|null = null
- $pickupPointCity : string|null = null
- $pickupPointZip : string|null = null
- $pickupPointCountry : string|null = null
- $pickupPointData : string|null = null
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
clearPickupPoint()
Clears all `pickup*` fields. Called when the tariff or shipper of an existing snapshot changes ({@see \App\UI\Api\Eshop\Models\Services\OrderSnapshotBuilder::buildShipper()} and `buildShipperFromRow()`) or when the applier finds that the new tariff does not require `external_pickup` ({@see \App\UI\Api\Eshop\Models\Services\OrderPickupPointApplier::apply()}). A pickup point belongs to one tariff/shipper; without clearing, the snapshot would keep the code and address of the original tariff's point after a switch.
public
clearPickupPoint() : 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>getName()
public
getName() : string
Return values
stringgetOrder()
public
getOrder() : TOrder|null
Return values
TOrder|nullgetPickupCarrier()
public
getPickupCarrier() : string|null
Return values
string|nullgetPickupPointCity()
public
getPickupPointCity() : string|null
Return values
string|nullgetPickupPointCode()
public
getPickupPointCode() : string|null
Return values
string|nullgetPickupPointCountry()
public
getPickupPointCountry() : string|null
Return values
string|nullgetPickupPointData()
public
getPickupPointData() : string|null
Return values
string|nullgetPickupPointName()
public
getPickupPointName() : string|null
Return values
string|nullgetPickupPointStreet()
public
getPickupPointStreet() : string|null
Return values
string|nullgetPickupPointZip()
public
getPickupPointZip() : string|null
Return values
string|nullgetPrice()
public
getPrice() : string
Return values
stringgetPriceWithVat()
public
getPriceWithVat() : string
Return values
stringgetShipper()
public
getShipper() : TShipper|null
Return values
TShipper|nullgetTariff()
public
getTariff() : TTariff|null
Return values
TTariff|nullgetVat()
public
getVat() : string
Return values
stringgetVatAsFloat()
public
getVatAsFloat() : float
Return values
floatsetName()
public
setName(string $name) : $this
Parameters
- $name : string
Return values
$thissetOrder()
public
setOrder(TOrder|null $order) : $this
Parameters
- $order : TOrder|null
Return values
$thissetPickupCarrier()
public
setPickupCarrier(string|null $pickupCarrier) : $this
Parameters
- $pickupCarrier : string|null
Return values
$thissetPickupPointCity()
public
setPickupPointCity(string|null $pickupPointCity) : $this
Parameters
- $pickupPointCity : string|null
Return values
$thissetPickupPointCode()
public
setPickupPointCode(string|null $pickupPointCode) : $this
Parameters
- $pickupPointCode : string|null
Return values
$thissetPickupPointCountry()
public
setPickupPointCountry(string|null $pickupPointCountry) : $this
Parameters
- $pickupPointCountry : string|null
Return values
$thissetPickupPointData()
public
setPickupPointData(string|null $pickupPointData) : $this
Parameters
- $pickupPointData : string|null
Return values
$thissetPickupPointName()
public
setPickupPointName(string|null $pickupPointName) : $this
Parameters
- $pickupPointName : string|null
Return values
$thissetPickupPointStreet()
public
setPickupPointStreet(string|null $pickupPointStreet) : $this
Parameters
- $pickupPointStreet : string|null
Return values
$thissetPickupPointZip()
public
setPickupPointZip(string|null $pickupPointZip) : $this
Parameters
- $pickupPointZip : string|null
Return values
$thissetPrice()
public
setPrice(string $price) : $this
Parameters
- $price : string
Return values
$thissetPriceWithVat()
public
setPriceWithVat(string $priceWithVat) : $this
Parameters
- $priceWithVat : string
Return values
$thissetShipper()
public
setShipper(TShipper|null $shipper) : $this
Parameters
- $shipper : TShipper|null
Return values
$thissetTariff()
public
setTariff(TTariff|null $tariff) : $this
Parameters
- $tariff : TTariff|null
Return values
$thissetVat()
public
setVat(string $vat) : $this
Parameters
- $vat : string
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>