OrderItem
class OrderItem implements OrderItemInterface, PrimaryKeyInterface, Serializable
Class OrderItem
Properties
| protected int | $id | ||
| protected Order | $order | ||
| protected Product | $product | Added product | |
| protected string | $state | State of order item. One of the predefined(COMPLETE, STATE_PARTIAL or STATE_UNCOMPLETE) | |
| protected int | $quantity | Number of products | |
| protected int | $numInStock | ||
| protected int | $quantityObtained | Number of products obtained. | |
| protected float | $unitPrice | Price of single product | |
| protected ArrayCollection | $adjustments | Collection of adjustments used for combination of user and this product | |
| protected float | $adjustmentsTotal | Total adjustment, represented in percentage | |
| protected float | $fixedAdjustmentsTotal | Fixed total adjustment, represented in default currency | |
| protected float | $taxValue | Tax value, represented in percentage | |
| protected float | $vatValue | Tax value, already calculated in price | |
| protected int | $total | Total cost of all products in order item including adjustments, represented in default currency | |
| protected ArrayCollection | $productAttValues | Collection of product attribute values | |
| protected string | $productSku | Sku of product. In case that product is deleted we can track which product was in order | |
| protected string | $productName | Name of product. In case that product is deleted we can track which product was in order |
Methods
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
Get id
Get item quantity.
Set quantity.
No description
No description
Return the order.
Get unit price of item.
Define the unit price of item.
{@inheritdoc}
No description
Get adjustments total.
{@inheritdoc}
Remove adjustment.
Clears all adjustments.
No description
No description
Calculate adjustments total.
No description
No description
Get item total.
Set item total.
Calculate total based on quantity and unit price.
Checks whether the item given as argument corresponds to the same cart item. Can be overwritten to enable merge quantities.
Merge the item given as argument corresponding to the same cart item.
Get item product.
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
No description
{@inheritdoc}
{@inheritdoc}
No description
Details
at line 232
float|int
getCalculatedBaseItemPrice()
at line 243
float|int
getPriceWithAdjustment(null $type = null, bool|false $useQty = false)
at line 268
float|int
calculateOnlyAdjustmentsForType(string $type, bool $useQty = false)
at line 287
string
getState()
at line 297
OrderItem
setState(string $state)
at line 307
int
getNumInStock()
at line 317
OrderItem
setNumInStock(int $numInStock)
at line 330
float|int
getPriceWithAdjustmentAndTax(null $type = null, bool|false $useQty = false)
at line 354
float
getAdjustmentTotalPrice(bool $useQty = false)
at line 367
float
getFullAdjustmentTotalPrice()
at line 377
array
getPriceWithAdjustmentForEachType(bool $useQty = false)
at line 404
array
getFullPriceWithAdjustmentForEachType()
at line 414
float|int
getFullPriceWithAdjustment(string|null $type = null)
at line 422
float
getUnitPriceWithQuantity()
at line 430
OrderItem
setTaxValue()
at line 463
__construct()
at line 474
OrderItem
setId(int $id)
at line 484
integer
getId()
Get id
at line 492
int
getQuantity()
Get item quantity.
at line 500
setQuantity(int $quantity)
Set quantity.
at line 516
OrderItem
incrementQuantity(int $quantity = 1)
at line 532
OrderItem
decrementQuantity(int $quantity = 1)
at line 546
OrderInterface
getOrder()
Return the order.
at line 554
setOrder(OrderInterface $order = null)
Set the order.
at line 564
int
getUnitPrice()
Get unit price of item.
at line 572
setUnitPrice(int $unitPrice)
Define the unit price of item.
at line 582
getActiveAdjustments()
{@inheritdoc}
at line 596
Collection|AdjustmentInterface[]
getAdjustments(null|string $type = null)
at line 612
addAdjustment(AdjustmentInterface $adjustment)
Add adjustment.
at line 625
removeAdjustment(AdjustmentInterface $adjustment)
Remove adjustment.
at line 638
hasAdjustment(AdjustmentInterface $adjustment)
{@inheritdoc}
at line 646
integer
getAdjustmentsTotal(null|string $type = null)
Get adjustments total.
at line 666
getAdjustmentsTotalForEachType()
{@inheritdoc}
at line 688
removeAdjustments(string $type)
Remove adjustment.
at line 705
clearAdjustments()
Clears all adjustments.
at line 715
float|int|mixed
getTaxValue()
at line 730
OrderItem
setAdjustmentsTotal(float $adjustmentsTotal)
at line 740
calculateAdjustmentsTotal()
Calculate adjustments total.
at line 772
OrderItem
setFixedAdjustmentsTotal(float $fixedAdjustmentsTotal)
at line 782
float
getFixedAdjustmentsTotal()
at line 790
int
getTotal()
Get item total.
at line 798
setTotal(int $total)
Set item total.
at line 808
calculateTotal()
Calculate total based on quantity and unit price.
Take adjustments into account.
at line 842
bool
equals(OrderItemInterface $orderItem)
Checks whether the item given as argument corresponds to the same cart item. Can be overwritten to enable merge quantities.
at line 865
merge(OrderItemInterface $orderItem, bool $throwOnInvalid = true, float $qty)
Merge the item given as argument corresponding to the same cart item.
at line 880
Product
getProduct()
Get item product.
at line 888
setProduct(Product $product)
Set product.
at line 900
Collection
getProductAttValues()
at line 910
OrderItem
setProductAttValues(mixed $productAttValues)
at line 922
OrderItem
addProductAttValue(ProductAttributeValues $productAttValue)
at line 935
OrderItem
removeProductAttValue(ProductAttributeValues $productAttValue)
at line 946
string
getProductSku()
at line 956
OrderItem
setProductSku(string $productSku)
at line 966
string
getProductName()
at line 976
OrderItem
setProductName(string $productName)
at line 986
int
getQuantityObtained()
at line 996
OrderItem
setQuantityObtained(int $quantityObtained)
at line 1006
float
getVatValue()
at line 1016
OrderItem
setVatValue(float $vatValue)
at line 1026
float|int
getTotalVatValue()
at line 1034
int
getAppropriateQuantity()
at line 1042
serialize()
{@inheritdoc}
at line 1066
unserialize($serialized)
{@inheritdoc}