CoolCMS API

OrderItemFee extends OrderItemFee
in package

Snapshot of an order item fee (name, unit price and rate at save time; `fee` is a reference only, `SET NULL`). Fees enter `total_price`: they are already included in `OrderItem::$price`/`$priceWithVat`, and this row is the breakdown for the admin detail and for the flat InvoiceItem row ("{fee} - {item}").

Tags
extends
Attributes
#[Entity]
#[Table]
$name: 'cms_mod_eshop_order_item_fees'
#[TableAlias]
'orderItemFee'

Table of Contents

Properties

$fee  : TFee|null
$id  : int|null
$name  : string
$orderItem  : TOrderItem|null
$price  : string
$priceWithVat  : string
$quantity  : int
$vat  : string

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.
getFee()  : TFee|null
getId()  : int|null
getName()  : string
getOrderItem()  : TOrderItem|null
getPrice()  : string
getPriceWithVat()  : string
getQuantity()  : int
getVat()  : string
getVatAsFloat()  : float
isPersisted()  : bool
setFee()  : $this
setId()  : $this
setName()  : $this
setOrderItem()  : $this
setPrice()  : $this
setPriceWithVat()  : $this
setQuantity()  : $this
setVat()  : $this
getTraitsRecursive()  : array<string, string>
Walks the trait list recursively and collects nested traits too.

Properties

$fee

protected TFee|null $fee = null

reference; the snapshot survives deleting the fee (SET NULL)

Attributes
#[EntityOf]
\App\UI\Admin\Eshop\Models\Entities\ProductSetFee::class
#[JoinColumn]
$name: 'cms_mod_eshop_product_set_fees_product_set_fee_id'
$referencedColumnName: 'product_set_fee_id'
$nullable: true
$onDelete: 'SET NULL'
#[ManyToOne]
$targetEntity: \App\UI\Admin\Eshop\Models\Entities\ProductSetFee::class
$fetch: 'LAZY'

$id

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

$name

protected string $name = ''
Attributes
#[Column]
$name: 'name'
$type: 'string'
$length: 255

$orderItem

protected TOrderItem|null $orderItem = null
Attributes
#[JoinColumn]
$name: 'cms_mod_eshop_order_items_order_item_id'
$referencedColumnName: 'order_item_id'
$nullable: false
$onDelete: 'CASCADE'
#[ManyToOne]
$targetEntity: \App\UI\Admin\Eshop\Models\Entities\OrderItem::class
$inversedBy: 'fees'
$fetch: 'LAZY'
#[ParentRef]

$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]

$quantity

protected int $quantity = 1
Attributes
#[Column]
$name: 'quantity'
$type: 'integer'
$options: ['unsigned' => true]

Methods

__construct()

public __construct([int|null $id = null ][, mixed $orderItem = null ][, mixed $fee = null ][, string $name = '' ][, string $price = '0.000' ][, string $priceWithVat = '0.000' ][, string $vat = '0.00' ][, int $quantity = 1 ]) : mixed
Parameters
$id : int|null = null
$orderItem : mixed = null
$fee : mixed = null
$name : string = ''
$price : string = '0.000'
$priceWithVat : string = '0.000'
$vat : string = '0.00'
$quantity : int = 1

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>

getFee()

public getFee() : TFee|null
Return values
TFee|null

getName()

public getName() : string
Return values
string

getOrderItem()

public getOrderItem() : TOrderItem|null
Return values
TOrderItem|null

getPrice()

public getPrice() : string
Return values
string

getPriceWithVat()

public getPriceWithVat() : string
Return values
string

getQuantity()

public getQuantity() : int
Return values
int

getVatAsFloat()

public getVatAsFloat() : float
Return values
float

setFee()

public setFee(TFee|null $fee) : $this
Parameters
$fee : TFee|null
Return values
$this

setId()

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

setName()

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

setOrderItem()

public setOrderItem(TOrderItem|null $orderItem) : $this
Parameters
$orderItem : TOrderItem|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

setQuantity()

public setQuantity(int $quantity) : $this
Parameters
$quantity : int
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