ComplaintItem
extends ComplaintItem
in package
Complaint line: a snapshot of the complained item (name, code, VAT, price from the original order at the time the complaint was created, like `OrderItem`). `productSet` and `orderItem` are references only (`SET NULL`); `orderItem` keeps the link to the original order line from which {@see \App\UI\Api\Eshop\Models\Managers\ComplaintStockManager} looks up the cost price of the issue document for the return.
Tags
Attributes
- #[Entity]
- #[Table]
- $name: 'cms_mod_eshop_complaint_items'
- #[TableAlias]
- 'complaintItem'
Table of Contents
Properties
- $approved : bool|null
- $code : string|null
- $complaint : TComplaint|null
- $id : int|null
- $name : string
- $orderItem : TOrderItem|null
- $price : string
- $priceWithVat : string
- $productSet : TProductSet|null
- $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.
- getApproved() : bool|null
- getCode() : string|null
- getComplaint() : TComplaint|null
- getId() : int|null
- getName() : string
- getOrderItem() : TOrderItem|null
- getPrice() : string
- getPriceWithVat() : string
- getProductSet() : TProductSet|null
- getQuantity() : int
- getVat() : string
- isPersisted() : bool
- setApproved() : $this
- setCode() : $this
- setComplaint() : $this
- setId() : $this
- setName() : $this
- setOrderItem() : $this
- setPrice() : $this
- setPriceWithVat() : $this
- setProductSet() : $this
- setQuantity() : $this
- setVat() : $this
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$approved
protected
bool|null
$approved
= null
Attributes
- #[Column]
- $name: 'approved'
- $type: 'boolean'
- $nullable: true
$code
protected
string|null
$code
= null
Attributes
- #[Column]
- $name: 'code'
- $type: 'string'
- $length: 45
- $nullable: true
$complaint
protected
TComplaint|null
$complaint
= null
Attributes
- #[JoinColumn]
- $name: 'cms_mod_eshop_complaints_complaint_id'
- $referencedColumnName: 'complaint_id'
- $nullable: false
- $onDelete: 'CASCADE'
- #[ManyToOne]
- $targetEntity: \App\UI\Api\Eshop\Models\Entities\Complaint::class
- $inversedBy: 'items'
- $fetch: 'LAZY'
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'complaint_item_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
reference to the original order line (SET NULL)
Attributes
- #[JoinColumn]
- $name: 'cms_mod_eshop_order_items_order_item_id'
- $referencedColumnName: 'order_item_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Api\Eshop\Models\Entities\OrderItem::class
- $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
$productSet
protected
TProductSet|null
$productSet
= null
reference; the snapshot survives deleting the set (SET NULL)
Attributes
- #[JoinColumn]
- $name: 'cms_mod_eshop_product_sets_product_set_id'
- $referencedColumnName: 'product_set_id'
- $nullable: true
- $onDelete: 'SET NULL'
- #[ManyToOne]
- $targetEntity: \App\UI\Api\Eshop\Models\Entities\ProductSet::class
- $fetch: 'LAZY'
$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 $complaint = null ][, mixed $productSet = null ][, mixed $orderItem = null ][, string $name = '' ][, string|null $code = null ][, int $quantity = 1 ][, string $price = '0.000' ][, string $priceWithVat = '0.000' ][, string $vat = '0.00' ][, bool|null $approved = null ]) : mixed
Parameters
- $id : int|null = null
- $complaint : mixed = null
- $productSet : mixed = null
- $orderItem : mixed = null
- $name : string = ''
- $code : string|null = null
- $quantity : int = 1
- $price : string = '0.000'
- $priceWithVat : string = '0.000'
- $vat : string = '0.00'
- $approved : bool|null = null
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>getApproved()
public
getApproved() : bool|null
Return values
bool|nullgetCode()
public
getCode() : string|null
Return values
string|nullgetComplaint()
public
getComplaint() : TComplaint|null
Return values
TComplaint|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
stringgetProductSet()
public
getProductSet() : TProductSet|null
Return values
TProductSet|nullgetQuantity()
public
getQuantity() : int
Return values
intgetVat()
public
getVat() : string
Return values
stringisPersisted()
public
isPersisted() : bool
Return values
boolsetApproved()
public
setApproved(bool|null $approved) : $this
Parameters
- $approved : bool|null
Return values
$thissetCode()
public
setCode(string|null $code) : $this
Parameters
- $code : string|null
Return values
$thissetComplaint()
public
setComplaint(TComplaint|null $complaint) : $this
Parameters
- $complaint : TComplaint|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
$thissetProductSet()
public
setProductSet(TProductSet|null $productSet) : $this
Parameters
- $productSet : TProductSet|null
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>