CoolCMS API

PaymentMethod extends BaseEntity
in package
implements IdentifiableInterface uses IdentifiableTrait, TranslationCollectionTrait

AbstractYes

Payment method: the eshop checkout code list. Not the same as Invoicer `PaymentMethod` (only an invoice label) or System `PaymentGate` (the gateway itself); the mapping between them is done by order processing, not here.

The method deliberately has no price collection. The matrix PaymentMethodPrice (availability and surcharge per currency) is keyed by (shipperTariff x paymentMethod x currency) and is an owned collection ShipperTariff::$paymentPrices edited in the tariff edit: availability and surcharge are properties of the tariff, not of the payment method. Read the matrix through the tariff, never through the method.

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

Table of Contents

Interfaces

IdentifiableInterface
Entity with a simple integer primary key. Most entities have one (often via {@see \App\Core\Traits\Shared\Models\Entities\IdentifiableTrait}); texts and links with a composite key do not, which is why `getId()` is not on {@see \App\Core\Base\BaseEntity}. Code that needs the id of a generic entity asks for this interface (parameter type, template bound, `instanceof`).

Properties

$available  : bool
$id  : int|null
$paymentGate  : TPaymentGate|null
$sendProformaInvoice  : bool
$supplyKindId  : int|null
$translations  : Collection<int, TTranslation>
$vat  : TVat|null

Methods

__construct()  : mixed
addTranslation()  : $this
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
getId()  : int|null
getPaymentGate()  : TPaymentGate|null
getSendProformaInvoice()  : bool
getSupplyKindId()  : int|null
getTranslation()  : TTranslation|null
getTranslations()  : Collection<int, TTranslation>
getVat()  : TVat|null
isAvailable()  : bool
isPersisted()  : bool
removeTranslation()  : $this
setAvailable()  : $this
setId()  : $this
setPaymentGate()  : $this
setSendProformaInvoice()  : $this
setSupplyKindId()  : TTranslation>
setTranslations()  : $this
setVat()  : $this
translationCollectionInit()  : void
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$available

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

$id

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

$paymentGate

protected TPaymentGate|null $paymentGate = null

$sendProformaInvoice

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

$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<int, TTranslation> $translations = new ArrayCollection()

Methods

__construct()

public __construct([int|null $id = null ][, mixed $vat = null ][, mixed $paymentGate = null ][, bool $sendProformaInvoice = false ][, bool $available = true ][, Collection $translations = new ArrayCollection() ][, int|null $supplyKindId = null ]) : mixed
Parameters
$id : int|null = null
$vat : mixed = null
$paymentGate : mixed = null
$sendProformaInvoice : bool = false
$available : bool = true
$translations : Collection = new ArrayCollection()
$supplyKindId : int|null = null

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>

getAvailable()

public getAvailable() : bool
Return values
bool

getPaymentGate()

public getPaymentGate() : TPaymentGate|null
Return values
TPaymentGate|null

getSendProformaInvoice()

public getSendProformaInvoice() : bool
Return values
bool

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>

getVat()

public getVat() : TVat|null
Return values
TVat|null

isAvailable()

public isAvailable() : bool
Return values
bool

removeTranslation()

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

setAvailable()

public setAvailable(bool $available) : $this
Parameters
$available : bool
Return values
$this

setId()

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

setPaymentGate()

public setPaymentGate(TPaymentGate|null $paymentGate) : $this
Parameters
$paymentGate : TPaymentGate|null
Return values
$this

setSendProformaInvoice()

public setSendProformaInvoice(bool $sendProformaInvoice) : $this
Parameters
$sendProformaInvoice : bool
Return values
$this

setSupplyKindId()

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

setTranslations()

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

setVat()

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