CoolCMS API

PaymentMethodPrice extends PaymentMethodPrice
in package

Has a surrogate PK (`payment_method_price_id`): the matrix is an append-only time series with its own `dateFrom`, see {@see BasePaymentMethodPrice}. Both associations are therefore plain FK columns, not part of the PK; logical uniqueness (tariff × paymentMethod × currency × dateFrom) is enforced by a unique index in the database, not by the Doctrine identifier.

$tariff keeps inversedBy: 'paymentPrices' (the matrix is a collection owned by the tariff); $paymentMethod is a pure value side without inversedBy, since the method does not hold the matrix.

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_mod_eshop_payment_method_prices'
#[TableAlias]
'paymentMethodPrice'

Table of Contents

Properties

$available  : bool
$currencyId  : int|null
$dateFrom  : DateTime|null
$freeFrom  : string|null
$id  : int|null
$paymentMethod  : TPaymentMethod|null
$price  : string
$tariff  : TShipperTariff|null
$useFreeFrom  : bool

Methods

__construct()  : mixed
callInitMethods()  : void
Calls `init{TraitName}()` for every used trait that defines such a method.
getAllTraits()  : array<string, string>
Returns all traits the class uses, including those used by parent classes and nested traits.
getAvailable()  : bool
getCurrencyId()  : int|null
getDateFrom()  : DateTime|null
getFreeFrom()  : string|null
getFreeFromAsFloat()  : float|null
getId()  : int|null
getPaymentMethod()  : TPaymentMethod|null
getPrice()  : string
getPriceAsFloat()  : float
getTariff()  : TShipperTariff|null
getUseFreeFrom()  : bool
isAvailable()  : bool
isPersisted()  : bool
isUseFreeFrom()  : bool
setAvailable()  : $this
setCurrencyId()  : $this
setDateFrom()  : $this
setFreeFrom()  : $this
setId()  : $this
setPaymentMethod()  : $this
setPrice()  : $this
setTariff()  : $this
setUseFreeFrom()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$available

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

$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: 'payment_method_price_id'
$type: 'integer'
$options: ['unsigned' => true]
#[GeneratedValue]
#[Id]

$paymentMethod

protected TPaymentMethod|null $paymentMethod = null
Attributes
#[JoinColumn]
$name: 'cms_mod_eshop_payment_methods_payment_method_id'
$referencedColumnName: 'payment_method_id'
$onDelete: 'CASCADE'
#[ManyToOne]
$targetEntity: \App\UI\Api\Eshop\Models\Entities\PaymentMethod::class

$price

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

$tariff

protected TShipperTariff|null $tariff = null
Attributes
#[JoinColumn]
$name: 'cms_mod_eshop_shipper_tariffs_shipper_tariff_id'
$referencedColumnName: 'shipper_tariff_id'
$onDelete: 'CASCADE'
#[ManyToOne]
$targetEntity: \App\UI\Api\Eshop\Models\Entities\ShipperTariff::class
$inversedBy: 'paymentPrices'

$useFreeFrom

protected bool $useFreeFrom = false
Attributes
#[Column]
$name: 'use_free_from'
$type: 'boolean'

Methods

__construct()

public __construct([int|null $id = null ][, mixed $tariff = null ][, mixed $paymentMethod = null ][, int|null $currencyId = null ][, DateTime|null $dateFrom = null ][, string $price = '0.000' ][, bool $available = false ][, string|null $freeFrom = null ][, bool $useFreeFrom = false ]) : mixed
Parameters
$id : int|null = null
$tariff : mixed = null
$paymentMethod : mixed = null
$currencyId : int|null = null
$dateFrom : DateTime|null = null
$price : string = '0.000'
$available : bool = false
$freeFrom : string|null = null
$useFreeFrom : bool = false

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

getPaymentMethod()

public getPaymentMethod() : TPaymentMethod|null
Return values
TPaymentMethod|null

getTariff()

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

setAvailable()

public setAvailable(bool $available) : $this
Parameters
$available : 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

setPaymentMethod()

public setPaymentMethod(TPaymentMethod|null $paymentMethod) : $this
Parameters
$paymentMethod : TPaymentMethod|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

setUseFreeFrom()

public setUseFreeFrom(bool $useFreeFrom) : $this
Parameters
$useFreeFrom : bool
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