OrderItemUnit
extends OrderItemUnit
in package
Frozen breakdown of an order item into Store stock items: a snapshot of `SetCompositionService::decompose()` at save time (stockItemQuantities x line quantity).
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_eshop_order_item_units'
- #[TableAlias]
- 'orderItemUnit'
Table of Contents
Properties
- $orderItem : OrderItem|null
- $quantity : int
- $stockItemId : int|null
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.
- getOrderItem() : TOrderItem|null
- getQuantity() : int
- getStockItemId() : int|null
- setOrderItem() : $this
- setQuantity() : $this
- setStockItemId() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$orderItem
protected
OrderItem|null
$orderItem
= null
Attributes
- #[Id]
- #[JoinColumn]
- $name: 'cms_mod_eshop_order_items_order_item_id'
- $referencedColumnName: 'order_item_id'
- $onDelete: 'CASCADE'
- #[ManyToOne]
- $targetEntity: \App\UI\Admin\Eshop\Models\Entities\OrderItem::class
- $inversedBy: 'units'
- #[ParentRef]
$quantity
protected
int
$quantity
= 0
Attributes
- #[Column]
- $name: 'quantity'
- $type: 'integer'
- $options: ['unsigned' => true]
$stockItemId
protected
int|null
$stockItemId
= null
Attributes
- #[Column]
- $name: 'stock_item_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[Id]
- #[Identity]
Methods
__construct()
public
__construct([mixed $orderItem = null ][, int|null $stockItemId = null ][, int $quantity = 0 ]) : mixed
Parameters
- $orderItem : mixed = null
- $stockItemId : int|null = null
- $quantity : int = 0
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>getOrderItem()
public
getOrderItem() : TOrderItem|null
Return values
TOrderItem|nullgetQuantity()
public
getQuantity() : int
Return values
intgetStockItemId()
public
getStockItemId() : int|null
Return values
int|nullsetOrderItem()
public
setOrderItem(TOrderItem|null $orderItem) : $this
Parameters
- $orderItem : TOrderItem|null
Return values
$thissetQuantity()
public
setQuantity(int $quantity) : $this
Parameters
- $quantity : int
Return values
$thissetStockItemId()
public
setStockItemId(int|null $stockItemId) : $this
Parameters
- $stockItemId : int|null
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>