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
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
- #[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\Api\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\Api\Eshop\Models\Entities\OrderItem::class
- $inversedBy: 'fees'
- $fetch: 'LAZY'
$price
protected
string
$price
= '0.000'
Attributes
- #[Column]
- $name: 'price'
- $type: 'decimal'
- $precision: 10
- $scale: 3
$priceWithVat
protected
string
$priceWithVat
= '0.000'
Attributes
- #[Column]
- $name: 'price_with_vat'
- $type: 'decimal'
- $precision: 10
- $scale: 3
$quantity
protected
int
$quantity
= 1
Attributes
- #[Column]
- $name: 'quantity'
- $type: 'integer'
- $options: ['unsigned' => true]
$vat
protected
string
$vat
= '0.00'
Attributes
- #[Column]
- $name: 'vat'
- $type: 'decimal'
- $precision: 5
- $scale: 2
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|nullgetId()
public
getId() : int|null
Return values
int|nullgetName()
public
getName() : string
Return values
stringgetOrderItem()
public
getOrderItem() : TOrderItem|null
Return values
TOrderItem|nullgetPrice()
public
getPrice() : string
Return values
stringgetPriceWithVat()
public
getPriceWithVat() : string
Return values
stringgetQuantity()
public
getQuantity() : int
Return values
intgetVat()
public
getVat() : string
Return values
stringgetVatAsFloat()
public
getVatAsFloat() : float
Return values
floatisPersisted()
public
isPersisted() : bool
Return values
boolsetFee()
public
setFee(TFee|null $fee) : $this
Parameters
- $fee : TFee|null
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetName()
public
setName(string $name) : $this
Parameters
- $name : string
Return values
$thissetOrderItem()
public
setOrderItem(TOrderItem|null $orderItem) : $this
Parameters
- $orderItem : TOrderItem|null
Return values
$thissetPrice()
public
setPrice(string $price) : $this
Parameters
- $price : string
Return values
$thissetPriceWithVat()
public
setPriceWithVat(string $priceWithVat) : $this
Parameters
- $priceWithVat : string
Return values
$thissetQuantity()
public
setQuantity(int $quantity) : $this
Parameters
- $quantity : int
Return values
$thissetVat()
public
setVat(string $vat) : $this
Parameters
- $vat : string
Return values
$thisgetTraitsRecursive()
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>