CoolCMS API

ShipperTariff extends ShipperTariff
in package

`$paymentPrices` is the payment matrix of the tariff: an owned collection of {@see PaymentMethodPrice} keyed by tariff, payment method and currency. It is edited in the tariff form and saved as a full replace through the object graph (`orphanRemoval`).

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_mod_eshop_shipper_tariffs'
#[TableAlias]
'shipperTariff'

Table of Contents

Properties

$branches  : Collection
$city  : string|null
$country  : string|null
$externalPickup  : bool
$id  : int|null
$latitude  : string|null
$longitude  : string|null
$paymentPrices  : Collection
$prices  : Collection
$shipper  : TShipper|null
$shipperRegion  : TShipperRegion|null
$street  : string|null
$supplyKindId  : int|null
$translations  : Collection
$useShipperBranches  : int
$zip  : string|null

Methods

__construct()  : mixed
addBranch()  : $this
addPaymentPrice()  : $this
addPrice()  : $this
addTranslation()  : $this
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
clearPrices()  : $this
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getBranches()  : Collection<int, TBranch>
Own branches of the tariff: owned collection, plain CRUD (no time series).
getCity()  : string|null
getCountry()  : string|null
getExternalPickup()  : bool
getId()  : int|null
getLatitude()  : string|null
getLatitudeAsFloat()  : float|null
getLongitude()  : string|null
getLongitudeAsFloat()  : float|null
getPaymentPrices()  : Collection<int, TPaymentPrice>
Payment matrix of the tariff (payment method × currency): owned collection, full replace.
getPrices()  : Collection<int, TPrice>
getShipper()  : TShipper|null
getShipperRegion()  : TShipperRegion|null
getStreet()  : string|null
getSupplyKindId()  : int|null
getTranslation()  : TTranslation|null
getTranslations()  : Collection<int, TTranslation>
getUseShipperBranches()  : int
getZip()  : string|null
isExternalPickup()  : bool
isPersisted()  : bool
priceCollectionInit()  : void
removePrice()  : $this
removeTranslation()  : $this
setBranches()  : $this
setCity()  : $this
setCountry()  : $this
setExternalPickup()  : $this
setId()  : $this
setLatitude()  : $this
setLongitude()  : $this
setPaymentPrices()  : $this
setPrices()  : $this
setShipper()  : $this
setShipperRegion()  : $this
setStreet()  : $this
setSupplyKindId()  : TBranch>
setTranslations()  : $this
setUseShipperBranches()  : $this
setZip()  : $this
translationCollectionInit()  : void
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$branches

protected Collection $branches
Attributes
#[CollectionOf]
\App\UI\Admin\Eshop\Models\Entities\ShipperTariffBranch::class
$owned: true
#[OneToMany]
$targetEntity: \App\UI\Admin\Eshop\Models\Entities\ShipperTariffBranch::class
$mappedBy: 'tariff'
$cascade: ['persist', 'remove']
$orphanRemoval: true
$fetch: 'LAZY'

$city

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

$country

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

$externalPickup

protected bool $externalPickup = false
Attributes
#[Column]
$name: 'external_pickup'
$type: 'boolean'

$id

protected int|null $id = null
Attributes
#[Column]
$name: 'shipper_tariff_id'
$type: 'integer'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

$latitude

protected string|null $latitude = null
Attributes
#[Column]
$name: 'latitude'
$type: 'decimal'
$precision: 10
$scale: 6
$nullable: true

$longitude

protected string|null $longitude = null
Attributes
#[Column]
$name: 'longitude'
$type: 'decimal'
$precision: 10
$scale: 6
$nullable: true

$paymentPrices

protected Collection $paymentPrices
Attributes
#[CollectionOf]
\App\UI\Admin\Eshop\Models\Entities\PaymentMethodPrice::class
$owned: true
#[OneToMany]
$targetEntity: \App\UI\Admin\Eshop\Models\Entities\PaymentMethodPrice::class
$mappedBy: 'tariff'
$cascade: ['persist', 'remove']
$orphanRemoval: true
$fetch: 'LAZY'

$prices

protected Collection $prices
Attributes
#[CollectionOf]
\App\UI\Admin\Eshop\Models\Entities\ShipperTariffPrice::class
$owned: true
#[OneToMany]
$targetEntity: \App\UI\Admin\Eshop\Models\Entities\ShipperTariffPrice::class
$mappedBy: 'tariff'
$cascade: ['persist', 'remove']
$orphanRemoval: true
$fetch: 'LAZY'

$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: false
$onDelete: 'CASCADE'
#[ManyToOne]
$targetEntity: \App\UI\Admin\Eshop\Models\Entities\Shipper::class
$fetch: 'LAZY'

$shipperRegion

protected TShipperRegion|null $shipperRegion = null
Attributes
#[EntityOf]
\App\UI\Admin\Eshop\Models\Entities\ShipperRegion::class
#[JoinColumn]
$name: 'cms_mod_eshop_shipper_regions_shipper_region_id'
$referencedColumnName: 'shipper_region_id'
$nullable: true
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Admin\Eshop\Models\Entities\ShipperRegion::class
$fetch: 'LAZY'

$street

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

$supplyKindId

protected int|null $supplyKindId = null
Attributes
#[Column]
$name: 'cms_system_supply_kinds_supply_kind_id'
$type: 'integer'
$nullable: true
$options: ['unsigned' => true]

$translations

protected Collection $translations
Attributes
#[CollectionOf]
\App\UI\Admin\Eshop\Models\Entities\ShipperTariffText::class
$owned: true
#[OneToMany]
$targetEntity: \App\UI\Admin\Eshop\Models\Entities\ShipperTariffText::class
$mappedBy: 'parent'
$cascade: ['persist', 'remove']
$orphanRemoval: true
$fetch: 'LAZY'

$useShipperBranches

protected int $useShipperBranches = 0
Attributes
#[Column]
$name: 'use_shipper_branches'
$type: 'integer'
$options: ['unsigned' => true]

$zip

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

Methods

__construct()

public __construct([int|null $id = null ][, mixed $shipper = null ][, mixed $shipperRegion = null ][, string|null $street = null ][, string|null $city = null ][, string|null $zip = null ][, string|null $country = null ][, string|null $latitude = null ][, string|null $longitude = null ][, int $useShipperBranches = 0 ][, bool $externalPickup = false ][, Collection $translations = new ArrayCollection() ][, Collection $prices = new ArrayCollection() ][, Collection $paymentPrices = new ArrayCollection() ][, Collection $branches = new ArrayCollection() ][, int|null $supplyKindId = null ]) : mixed
Parameters
$id : int|null = null
$shipper : mixed = null
$shipperRegion : mixed = null
$street : string|null = null
$city : string|null = null
$zip : string|null = null
$country : string|null = null
$latitude : string|null = null
$longitude : string|null = null
$useShipperBranches : int = 0
$externalPickup : bool = false
$translations : Collection = new ArrayCollection()
$prices : Collection = new ArrayCollection()
$paymentPrices : Collection = new ArrayCollection()
$branches : Collection = new ArrayCollection()
$supplyKindId : int|null = null

addBranch()

public addBranch(TBranch $branch) : $this
Parameters
$branch : TBranch
Return values
$this

addPaymentPrice()

public addPaymentPrice(TPaymentPrice $paymentPrice) : $this
Parameters
$paymentPrice : TPaymentPrice
Return values
$this

addPrice()

public addPrice(TPrice $price) : $this
Parameters
$price : TPrice
Return values
$this

addTranslation()

public addTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

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>

getBranches()

Own branches of the tariff: owned collection, plain CRUD (no time series).

public getBranches() : Collection<int, TBranch>
Return values
Collection<int, TBranch>

getCity()

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

getCountry()

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

getExternalPickup()

public getExternalPickup() : bool
Return values
bool

getLatitude()

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

getLatitudeAsFloat()

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

getLongitude()

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

getLongitudeAsFloat()

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

getPaymentPrices()

Payment matrix of the tariff (payment method × currency): owned collection, full replace.

public getPaymentPrices() : Collection<int, TPaymentPrice>
Return values
Collection<int, TPaymentPrice>

getPrices()

public getPrices() : Collection<int, TPrice>
Return values
Collection<int, TPrice>

getShipper()

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

getShipperRegion()

public getShipperRegion() : TShipperRegion|null
Return values
TShipperRegion|null

getStreet()

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

getSupplyKindId()

public getSupplyKindId() : int|null
Return values
int|null

getTranslation()

public getTranslation(int $langId) : TTranslation|null
Parameters
$langId : int
Return values
TTranslation|null

getTranslations()

public getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>

getUseShipperBranches()

public getUseShipperBranches() : int
Return values
int

getZip()

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

isExternalPickup()

public isExternalPickup() : bool
Return values
bool

removePrice()

public removePrice(TPrice $price) : $this
Parameters
$price : TPrice
Return values
$this

removeTranslation()

public removeTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

setBranches()

public setBranches(Collection<int, TBranch>|array<int, TBranch> $branches) : $this
Parameters
$branches : Collection<int, TBranch>|array<int, TBranch>
Return values
$this

setCity()

public setCity(string|null $city) : $this
Parameters
$city : string|null
Return values
$this

setCountry()

public setCountry(string|null $country) : $this
Parameters
$country : string|null
Return values
$this

setExternalPickup()

public setExternalPickup(bool $externalPickup) : $this
Parameters
$externalPickup : bool
Return values
$this

setId()

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

setLatitude()

public setLatitude(string|null $latitude) : $this
Parameters
$latitude : string|null
Return values
$this

setLongitude()

public setLongitude(string|null $longitude) : $this
Parameters
$longitude : string|null
Return values
$this

setPaymentPrices()

public setPaymentPrices(Collection<int, TPaymentPrice>|array<int, TPaymentPrice> $paymentPrices) : $this
Parameters
$paymentPrices : Collection<int, TPaymentPrice>|array<int, TPaymentPrice>
Return values
$this

setPrices()

public setPrices(Collection<int, TPrice>|array<int, TPrice> $prices) : $this
Parameters
$prices : Collection<int, TPrice>|array<int, TPrice>
Return values
$this

setShipper()

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

setShipperRegion()

public setShipperRegion(TShipperRegion|null $shipperRegion) : $this
Parameters
$shipperRegion : TShipperRegion|null
Return values
$this

setStreet()

public setStreet(string|null $street) : $this
Parameters
$street : string|null
Return values
$this

setSupplyKindId()

public setSupplyKindId(int|null $supplyKindId) : TBranch>
Parameters
$supplyKindId : int|null
Return values
TBranch>

setTranslations()

public setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
$translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$this

setUseShipperBranches()

public setUseShipperBranches(int $useShipperBranches) : $this
Parameters
$useShipperBranches : int
Return values
$this

setZip()

public setZip(string|null $zip) : $this
Parameters
$zip : 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