CoolCMS API

OrderShipper extends BaseEntity
in package

AbstractYes

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.

pickup* is a snapshot of the pickup point chosen in the carrier widget at checkout. IMPORTANT: none of these columns is an FK to a point table (none exists), so an old order stays readable after the carrier closes a locker. pickupCarrier holds the driver script_name at order time, not a reference to Shipper. pickupPointData is the raw (sanitized) widget payload; it is only stored today and nothing reads it.

#[ExternalReadonly], like price/priceWithVat/vat above: the fields are written only by OrderCheckoutManager (driver normalizePickupPoint() plus sanitization), not by the client. An external Api caller must not set them, which would bypass the fail-closed guard and the sanitization.

Tags
template
Attributes
#[MappedSuperclass]
#[TableAlias]
$alias: 'orderShipper'

Table of Contents

Properties

$name  : string
$order  : TOrder|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

$pickupCarrier

protected string|null $pickupCarrier = null
Attributes
#[Column]
$name: 'pickup_carrier'
$type: 'string'
$length: 45
$nullable: true
#[ExternalReadonly]

$pickupPointCity

protected string|null $pickupPointCity = null
Attributes
#[Column]
$name: 'pickup_point_city'
$type: 'string'
$length: 100
$nullable: true
#[ExternalReadonly]

$pickupPointCode

protected string|null $pickupPointCode = null
Attributes
#[Column]
$name: 'pickup_point_code'
$type: 'string'
$length: 64
$nullable: true
#[ExternalReadonly]

$pickupPointCountry

protected string|null $pickupPointCountry = null
Attributes
#[Column]
$name: 'pickup_point_country'
$type: 'string'
$length: 60
$nullable: true
#[ExternalReadonly]

$pickupPointData

protected string|null $pickupPointData = null
Attributes
#[Column]
$name: 'pickup_point_data'
$type: 'text'
$nullable: true
#[ExternalReadonly]

$pickupPointName

protected string|null $pickupPointName = null
Attributes
#[Column]
$name: 'pickup_point_name'
$type: 'string'
$length: 255
$nullable: true
#[ExternalReadonly]

$pickupPointStreet

protected string|null $pickupPointStreet = null
Attributes
#[Column]
$name: 'pickup_point_street'
$type: 'string'
$length: 100
$nullable: true
#[ExternalReadonly]

$pickupPointZip

protected string|null $pickupPointZip = null
Attributes
#[Column]
$name: 'pickup_point_zip'
$type: 'string'
$length: 10
$nullable: true
#[ExternalReadonly]

$price

protected string $price = '0.000'
Attributes
#[Column]
$name: 'price'
$type: 'decimal'
$precision: 10
$scale: 3
#[ExternalReadonly]

$priceWithVat

protected string $priceWithVat = '0.000'
Attributes
#[Column]
$name: 'price_with_vat'
$type: 'decimal'
$precision: 10
$scale: 3
#[ExternalReadonly]

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
string

getOrder()

public getOrder() : TOrder|null
Return values
TOrder|null

getPickupCarrier()

public getPickupCarrier() : string|null
Return values
string|null

getPickupPointCity()

public getPickupPointCity() : string|null
Return values
string|null

getPickupPointCode()

public getPickupPointCode() : string|null
Return values
string|null

getPickupPointCountry()

public getPickupPointCountry() : string|null
Return values
string|null

getPickupPointData()

public getPickupPointData() : string|null
Return values
string|null

getPickupPointName()

public getPickupPointName() : string|null
Return values
string|null

getPickupPointStreet()

public getPickupPointStreet() : string|null
Return values
string|null

getPickupPointZip()

public getPickupPointZip() : string|null
Return values
string|null

getPrice()

public getPrice() : string
Return values
string

getPriceWithVat()

public getPriceWithVat() : string
Return values
string

getShipper()

public getShipper() : TShipper|null
Return values
TShipper|null

getTariff()

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

getVatAsFloat()

public getVatAsFloat() : float
Return values
float

setName()

public setName(string $name) : $this
Parameters
$name : string
Return values
$this

setOrder()

public setOrder(TOrder|null $order) : $this
Parameters
$order : TOrder|null
Return values
$this

setPickupCarrier()

public setPickupCarrier(string|null $pickupCarrier) : $this
Parameters
$pickupCarrier : string|null
Return values
$this

setPickupPointCity()

public setPickupPointCity(string|null $pickupPointCity) : $this
Parameters
$pickupPointCity : string|null
Return values
$this

setPickupPointCode()

public setPickupPointCode(string|null $pickupPointCode) : $this
Parameters
$pickupPointCode : string|null
Return values
$this

setPickupPointCountry()

public setPickupPointCountry(string|null $pickupPointCountry) : $this
Parameters
$pickupPointCountry : string|null
Return values
$this

setPickupPointData()

public setPickupPointData(string|null $pickupPointData) : $this
Parameters
$pickupPointData : string|null
Return values
$this

setPickupPointName()

public setPickupPointName(string|null $pickupPointName) : $this
Parameters
$pickupPointName : string|null
Return values
$this

setPickupPointStreet()

public setPickupPointStreet(string|null $pickupPointStreet) : $this
Parameters
$pickupPointStreet : string|null
Return values
$this

setPickupPointZip()

public setPickupPointZip(string|null $pickupPointZip) : $this
Parameters
$pickupPointZip : string|null
Return values
$this

setPrice()

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

setPriceWithVat()

public setPriceWithVat(string $priceWithVat) : $this
Parameters
$priceWithVat : string
Return values
$this

setShipper()

public setShipper(TShipper|null $shipper) : $this
Parameters
$shipper : TShipper|null
Return values
$this

setTariff()

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

setVat()

public setVat(string $vat) : $this
Parameters
$vat : string
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