class Order implements OrderInterface, PrimaryKeyInterface, PromotionSubjectInterface, AdjustableInterface, Serializable

Class Order

Properties

protected int $id
protected string $number Order number
protected DateTime $completedAt Completion date
protected string $paymentType Name of payment type(in english language)
protected array $paymentAdditionalInfo Data send from bank after payment
protected string|null $paymentTransactionId Transaction id received from bank after payment
protected string|null $paymentMerchantTransactionId Unique id for order(for bank payment) Combination of order id and time()
protected string|null $cardPaymentState Card payment status
protected ArrayCollection $items Collection of order items
protected float $itemsTotal Total cost of all items in order, represented in default currency
protected float $baseItemsTotal Total cost of all items in order without adjustments, represented in default currency
protected ArrayCollection $adjustments Collection of all adjustments for order
protected float $deliveryServicePrice Cost of delivery service, represented in default currency
protected string $deliveryServiceCode Code of delivery service
protected User $user User that created order. NULL if no user is logged
protected float $adjustmentsTotal Sum of all adjustments, represented in percentage
protected int $code Unique value for order used in synchronization with erp
protected string $locale Language locale when order was created
protected string $currency Currency name for which order was created
protected float $currencyRatio Ratio for currency relative to default currency
protected Pricelist $currentPricelist Pricelist that user had when order was created
protected float $taxValue Tax value, represented in percentage
protected float $vatValue Tax value, already calculated in price
protected float $totalWithTax Total cost of all items in order including tax, represented in default currency
protected float $totalWithDeliveryService Total cost of all items in order including tax and delivery service cost, represented in default currency
protected float $total Total cost of all items in order including adjustments, represented in default currency Items total + adjustments total.
protected bool $confirmed Indicates if order has been confirmed by mail.
protected string $confirmationToken Random string used to confirm order
protected DateTime $createdAt Datetime when order was created
protected DateTime $updatedAt Datetime when order was last updated
protected string $state State of order
protected Address $address Billing address for order
protected Address $shippingAddress Shipping Address for order. If NULL same as billing
protected ArrayCollection $promotions Collection of promotions
protected float $discount Order discount, represented in default currency
protected Tax $tax Tax for order
array $previousStates Collection of all previous states
protected string $checkoutComment Order comment
protected string $anonymous Name of user that created order(if user is not logged in)
protected string $sessionId Unique identifier for order
protected string $anonymousMail Email of user that created order(if user is not logged in)
protected string $couponCode Coupon code
protected bool $synchronizedWithErp Indicates if order is synchronized with erp
protected string $erpSynchronizationComment Erp Synchronization Comment
protected bool $hasAddress Indicates if user has entered/selected address

Methods

__construct()

Order constructor.

integer
getId()

Get id

setId(mixed $id)

No description

float
getBaseItemsTotal()

No description

setBaseItemsTotal(float $baseItemsTotal)

No description

string
getCode()

No description

setCode(string $code)

No description

bool
isCompleted()

Has the order been completed by user and can be handled.

complete()

Mark the order as completed.

getCompletedAt()

Return completion date.

setCompletedAt(DateTime $completedAt = null)

Set completion time.

float
getVatValue()

No description

setVatValue(float $vatValue)

No description

getSequenceType()

{@inheritdoc}

Collection|OrderItemInterface[]
getItems()

Get order items.

setItems(Collection $items)

Set items.

clearItems()

Clears all items in cart.

integer
countItems()

Returns number of order items.

addItem(OrderItemInterface $item, float $price, float $qty)

Adds item to order.

removeItem(OrderItemInterface $item)

Remove item from order.

Boolean
hasItem(OrderItemInterface $item, $selectedProductAttributes = array(), $excludedOrderItemIds = null)

Has item in order?

integer
getItemsTotal()

Get items total.

setItemsTotal($itemsTotal)

{@inheritdoc}

calculateItemsTotal()

Calculate items total based on the items unit prices and quantities.

Collection|AdjustmentInterface[]
getAdjustments(null|string $type = null)

Return all adjustments attached to adjustable subject.

addAdjustment(AdjustmentInterface $adjustment)

Add adjustment.

removeAdjustment(AdjustmentInterface $adjustment)

Remove adjustment.

hasAdjustment(AdjustmentInterface $adjustment)

{@inheritdoc}

integer
getAdjustmentsTotal(null|string $type = null)

Get adjustments total.

setAdjustmentsTotal(float $adjustmentsTotal)

No description

removeAdjustments(string $type)

Remove adjustment.

clearAdjustments()

Clears all adjustments.

calculateAdjustmentsTotal()

Calculate adjustments total.

integer
getTotal()

Get order total.

setTotal(integer $total)

Set total.

calculateTotal()

Calculate total.

calculateTotalWithTax()

No description

mixed
getCreatedAt()

No description

mixed
setCreatedAt(DateTime $createdAt)

No description

mixed
getUpdatedAt()

No description

mixed
setUpdatedAt(DateTime $updatedAt)

No description

setState(string $state)

Set order state.

string
getState()

Get order state.

getTotalItems()

Alias of {@link countItems()}.

integer
getTotalQuantity()

Returns total quantity of items in cart.

Boolean
isEmpty()

Checks whether the cart is empty or not.

getUser()

Get user.

setUser(User $user)

Set user.

mixed
removeItemQty(OrderItemInterface $item)

No description

getShipping()

No description

setShipping(ShippingProvider|null $shipping)

No description

mixed
getPaymentType()

No description

setPaymentType(string $paymentType)

No description

array
getPaymentAdditionalInfo()

No description

setPaymentAdditionalInfo(array $paymentAdditionalInfo)

No description

mixed
getPaymentTransactionId()

No description

setPaymentTransactionId(string|null $paymentTransactionId)

No description

mixed
setPaymentMerchantTransactionId(string|null $paymentMerchantTransactionId)

No description

mixed
getUserForJqGrid()

No description

string
getShippingForJqGrid()

No description

string
getCompanyForJqGrid()

No description

string
getCountryForJqGrid()

No description

int
getIdForJqGrid()

No description

string
getPaymentForJqGrid()

No description

float
getItemsAdjustmentTotalCost(string $type)

No description

mixed
getAddress()

No description

string
getAddressToString()

No description

setAddress(mixed $address)

No description

Address|null
getShippingAddress()

No description

setShippingAddress(Address $shippingAddress)

No description

string
serialize()

(PHP 5 >= 5.1.0)
String representation of object

void
unserialize(string $serialized)

(PHP 5 >= 5.1.0)
Constructs the object

Boolean
hasPromotion(PromotionInterface $promotion)

Has Promotion.

Collection|PromotionInterface[]
getPromotions()

Get Promotions.

integer
getPromotionSubjectCount()

Count promotion subjects.

float
getDiscount()

No description

setDiscount(float $discount)

No description

Tax
getTax()

No description

setTax(Tax $tax)

No description

float
getDeliveryServicePrice()

No description

setDeliveryServicePrice(float $deliveryServicePrice)

No description

string
getDeliveryServiceCode()

No description

setDeliveryServiceCode(string $deliveryServiceCode)

No description

float
getTaxValue()

No description

setTaxValue(float $taxValue)

No description

float
getTotalWithTax()

No description

float
getTotalWithDeliveryService()

No description

setTotalWithDeliveryService(float $totalWithDeliveryService)

No description

setTotalWithTax(float $taxValue)

No description

boolean
isHasAddress()

No description

setHasAddress(boolean $hasAddress)

No description

string
getCheckoutComment()

No description

setCheckoutComment(string $checkoutComment)

No description

float
getTotalWithoutDiscount()

No description

string
getLocale()

No description

setLocale(string $locale)

No description

string
getCurrency()

No description

setCurrency(string $currency)

No description

boolean
isConfirmed()

No description

string
getAnonymous()

No description

setAnonymous(string $anonymous)

No description

setConfirmed(boolean $confirmed)

No description

string
getConfirmationToken()

No description

setConfirmationToken(string $confirmationToken)

No description

setPreviousStates(array $previousStates)

No description

string
getCurrencyRatio()

No description

setCurrencyRatio(string $currencyRatio)

No description

string
getAnonymousMail()

No description

setAnonymousMail(string $anonymousMail)

No description

float
getTaxTotal()

No description

string
getCouponCode()

No description

setCouponCode(string $couponCode)

No description

string
getSessionId()

No description

setSessionId(string $sessionId)

No description

array
getPreviousStates()

No description

mixed
getCardPaymentState()

No description

setCardPaymentState(mixed $cardPaymentState)

No description

getCurrentPricelist()

No description

setCurrentPricelist(Pricelist|Proxy $currentPricelist)

No description

bool
isSynchronizedWithErp()

No description

setSynchronizedWithErp(bool $synchronizedWithErp)

No description

string
getErpSynchronizationComment()

No description

setErpSynchronizationComment(string $erpSynchronizationComment)

No description

string
getNumber()

No description

setNumber(string $number)

No description

Details

at line 603
__construct()

Order constructor.

at line 614
integer getId()

Get id

Return Value

integer

at line 624
Order setId(mixed $id)

Parameters

mixed $id

Return Value

Order

at line 634
float getBaseItemsTotal()

Return Value

float

at line 644
Order setBaseItemsTotal(float $baseItemsTotal)

Parameters

float $baseItemsTotal

Return Value

Order

at line 654
string getCode()

Return Value

string

at line 664
Order setCode(string $code)

Parameters

string $code

Return Value

Order

at line 674
bool isCompleted()

Has the order been completed by user and can be handled.

Return Value

bool

at line 682
complete()

Mark the order as completed.

at line 692
DateTime getCompletedAt()

Return completion date.

Return Value

DateTime

at line 700
setCompletedAt(DateTime $completedAt = null)

Set completion time.

Parameters

DateTime $completedAt

at line 710
float getVatValue()

Return Value

float

at line 720
Order setVatValue(float $vatValue)

Parameters

float $vatValue

Return Value

Order

at line 730
getSequenceType()

{@inheritdoc}

at line 738
Collection|OrderItemInterface[] getItems()

Get order items.

Return Value

Collection|OrderItemInterface[] An array or collection of OrderItemInterface

at line 746
setItems(Collection $items)

Set items.

Parameters

Collection $items

at line 756
clearItems()

Clears all items in cart.

at line 766
integer countItems()

Returns number of order items.

Return Value

integer

at line 774
addItem(OrderItemInterface $item, float $price, float $qty)

Adds item to order.

Parameters

OrderItemInterface $item
float $price
float $qty

at line 790
removeItem(OrderItemInterface $item)

Remove item from order.

Parameters

OrderItemInterface $item

at line 803
Boolean hasItem(OrderItemInterface $item, $selectedProductAttributes = array(), $excludedOrderItemIds = null)

Has item in order?

Parameters

OrderItemInterface $item
$selectedProductAttributes
$excludedOrderItemIds

Return Value

Boolean

at line 849
integer getItemsTotal()

Get items total.

Return Value

integer

at line 857
setItemsTotal($itemsTotal)

{@inheritdoc}

Parameters

$itemsTotal

at line 867
calculateItemsTotal()

Calculate items total based on the items unit prices and quantities.

at line 890
Collection|AdjustmentInterface[] getAdjustments(null|string $type = null)

Return all adjustments attached to adjustable subject.

Parameters

null|string $type

Return Value

Collection|AdjustmentInterface[]

at line 906
addAdjustment(AdjustmentInterface $adjustment)

Add adjustment.

Parameters

AdjustmentInterface $adjustment

at line 919
removeAdjustment(AdjustmentInterface $adjustment)

Remove adjustment.

Parameters

AdjustmentInterface $adjustment

at line 932
hasAdjustment(AdjustmentInterface $adjustment)

{@inheritdoc}

Parameters

AdjustmentInterface $adjustment

at line 940
integer getAdjustmentsTotal(null|string $type = null)

Get adjustments total.

Parameters

null|string $type

Return Value

integer

at line 959
Order setAdjustmentsTotal(float $adjustmentsTotal)

Parameters

float $adjustmentsTotal

Return Value

Order

at line 969
removeAdjustments(string $type)

Remove adjustment.

Parameters

string $type

at line 985
clearAdjustments()

Clears all adjustments.

at line 995
calculateAdjustmentsTotal()

Calculate adjustments total.

at line 1009
integer getTotal()

Get order total.

Return Value

integer

at line 1017
setTotal(integer $total)

Set total.

Parameters

integer $total

at line 1027
calculateTotal()

Calculate total.

Items total + Adjustments total.

at line 1046
Order calculateTotalWithTax()

Return Value

Order

at line 1079
mixed getCreatedAt()

Return Value

mixed

at line 1087
mixed setCreatedAt(DateTime $createdAt)

Parameters

DateTime $createdAt

Return Value

mixed

at line 1097
mixed getUpdatedAt()

Return Value

mixed

at line 1105
mixed setUpdatedAt(DateTime $updatedAt)

Parameters

DateTime $updatedAt

Return Value

mixed

at line 1115
setState(string $state)

Set order state.

Parameters

string $state

at line 1125
string getState()

Get order state.

Return Value

string

at line 1133
getTotalItems()

Alias of {@link countItems()}.

at line 1141
integer getTotalQuantity()

Returns total quantity of items in cart.

Return Value

integer

at line 1155
Boolean isEmpty()

Checks whether the cart is empty or not.

Return Value

Boolean

at line 1163
User getUser()

Get user.

Return Value

User

at line 1171
setUser(User $user)

Set user.

Parameters

User $user

at line 1184
mixed removeItemQty(OrderItemInterface $item)

Parameters

OrderItemInterface $item

Return Value

mixed

at line 1211
ShippingProvider getShipping()

Return Value

ShippingProvider

at line 1219
setShipping(ShippingProvider|null $shipping)

Parameters

ShippingProvider|null $shipping

at line 1232
mixed getPaymentType()

Return Value

mixed

at line 1240
setPaymentType(string $paymentType)

Parameters

string $paymentType

at line 1250
array getPaymentAdditionalInfo()

Return Value

array

at line 1260
Order setPaymentAdditionalInfo(array $paymentAdditionalInfo)

Parameters

array $paymentAdditionalInfo

Return Value

Order

at line 1270
mixed getPaymentTransactionId()

Return Value

mixed

at line 1280
Order setPaymentTransactionId(string|null $paymentTransactionId)

Parameters

string|null $paymentTransactionId

Return Value

Order

at line 1290
mixed getPaymentMerchantTransactionId()

Return Value

mixed

at line 1300
Order setPaymentMerchantTransactionId(string|null $paymentMerchantTransactionId)

Parameters

string|null $paymentMerchantTransactionId

Return Value

Order

at line 1314
mixed getUserForJqGrid()

Return Value

mixed

at line 1331
string getShippingForJqGrid()

Return Value

string

at line 1347
string getCompanyForJqGrid()

Return Value

string

at line 1366
string getCountryForJqGrid()

Return Value

string

at line 1382
int getIdForJqGrid()

Return Value

int

at line 1394
string getPaymentForJqGrid()

Return Value

string

at line 1404
float getItemsAdjustmentTotalCost(string $type)

Parameters

string $type

Return Value

float

at line 1418
mixed getAddress()

Return Value

mixed

at line 1426
string getAddressToString()

Return Value

string

at line 1440
setAddress(mixed $address)

Parameters

mixed $address

at line 1451
Address|null getShippingAddress()

Return Value

Address|null

at line 1461
Order setShippingAddress(Address $shippingAddress)

Parameters

Address $shippingAddress

Return Value

Order

at line 1476
string serialize()

(PHP 5 >= 5.1.0)
String representation of object

Return Value

string the string representation of the object or null

at line 1526
void unserialize(string $serialized)

(PHP 5 >= 5.1.0)
Constructs the object

Parameters

string $serialized The string representation of the object.

Return Value

void

at line 1571
Boolean hasPromotion(PromotionInterface $promotion)

Has Promotion.

Parameters

PromotionInterface $promotion

Return Value

Boolean

at line 1583
PromotionSubjectInterface addPromotion(PromotionInterface $promotion)

Add Promotion.

Parameters

PromotionInterface $promotion

Return Value

PromotionSubjectInterface

at line 1601
PromotionSubjectInterface removePromotion(PromotionInterface $promotion)

Remove Promotion.

Parameters

PromotionInterface $promotion

Return Value

PromotionSubjectInterface

at line 1613
Collection|PromotionInterface[] getPromotions()

Get Promotions.

Return Value

Collection|PromotionInterface[]

at line 1623
integer getPromotionSubjectCount()

Count promotion subjects.

Return Value

integer

at line 1631
float getDiscount()

Return Value

float

at line 1641
Order setDiscount(float $discount)

Parameters

float $discount

Return Value

Order

at line 1651
Tax getTax()

Return Value

Tax

at line 1661
Order setTax(Tax $tax)

Parameters

Tax $tax

Return Value

Order

at line 1672
float getDeliveryServicePrice()

Return Value

float

at line 1682
Order setDeliveryServicePrice(float $deliveryServicePrice)

Parameters

float $deliveryServicePrice

Return Value

Order

at line 1692
string getDeliveryServiceCode()

Return Value

string

at line 1702
Order setDeliveryServiceCode(string $deliveryServiceCode)

Parameters

string $deliveryServiceCode

Return Value

Order

at line 1712
float getTaxValue()

Return Value

float

at line 1722
Order setTaxValue(float $taxValue)

Parameters

float $taxValue

Return Value

Order

at line 1733
float getTotalWithTax()

Return Value

float

at line 1741
float getTotalWithDeliveryService()

Return Value

float

at line 1755
Order setTotalWithDeliveryService(float $totalWithDeliveryService)

Parameters

float $totalWithDeliveryService

Return Value

Order

at line 1767
Order setTotalWithTax(float $taxValue)

Parameters

float $taxValue

Return Value

Order

at line 1777
boolean isHasAddress()

Return Value

boolean

at line 1787
Order setHasAddress(boolean $hasAddress)

Parameters

boolean $hasAddress

Return Value

Order

at line 1797
string getCheckoutComment()

Return Value

string

at line 1807
Order setCheckoutComment(string $checkoutComment)

Parameters

string $checkoutComment

Return Value

Order

at line 1817
float getTotalWithoutDiscount()

Return Value

float

at line 1825
string getLocale()

Return Value

string

at line 1835
Order setLocale(string $locale)

Parameters

string $locale

Return Value

Order

at line 1845
string getCurrency()

Return Value

string

at line 1855
Order setCurrency(string $currency)

Parameters

string $currency

Return Value

Order

at line 1865
boolean isConfirmed()

Return Value

boolean

at line 1872
string getAnonymous()

Return Value

string

at line 1882
Order setAnonymous(string $anonymous)

Parameters

string $anonymous

Return Value

Order

at line 1894
Order setConfirmed(boolean $confirmed)

Parameters

boolean $confirmed

Return Value

Order

at line 1904
string getConfirmationToken()

Return Value

string

at line 1914
Order setConfirmationToken(string $confirmationToken)

Parameters

string $confirmationToken

Return Value

Order

at line 1926
Order setPreviousStates(array $previousStates)

Parameters

array $previousStates

Return Value

Order

at line 1936
string getCurrencyRatio()

Return Value

string

at line 1946
Order setCurrencyRatio(string $currencyRatio)

Parameters

string $currencyRatio

Return Value

Order

at line 1956
string getAnonymousMail()

Return Value

string

at line 1966
Order setAnonymousMail(string $anonymousMail)

Parameters

string $anonymousMail

Return Value

Order

at line 1976
float getTaxTotal()

Return Value

float

at line 1990
string getCouponCode()

Return Value

string

at line 2000
Order setCouponCode(string $couponCode)

Parameters

string $couponCode

Return Value

Order

at line 2010
string getSessionId()

Return Value

string

at line 2020
Order setSessionId(string $sessionId)

Parameters

string $sessionId

Return Value

Order

at line 2030
array getPreviousStates()

Return Value

array

at line 2038
mixed getCardPaymentState()

Return Value

mixed

at line 2048
Order setCardPaymentState(mixed $cardPaymentState)

Parameters

mixed $cardPaymentState

Return Value

Order

at line 2058
Pricelist getCurrentPricelist()

Return Value

Pricelist

at line 2068
Order setCurrentPricelist(Pricelist|Proxy $currentPricelist)

Parameters

Pricelist|Proxy $currentPricelist

Return Value

Order

at line 2078
bool isSynchronizedWithErp()

Return Value

bool

at line 2088
Order setSynchronizedWithErp(bool $synchronizedWithErp)

Parameters

bool $synchronizedWithErp

Return Value

Order

at line 2098
string getErpSynchronizationComment()

Return Value

string

at line 2108
Order setErpSynchronizationComment(string $erpSynchronizationComment)

Parameters

string $erpSynchronizationComment

Return Value

Order

at line 2118
string getNumber()

Return Value

string

at line 2128
Order setNumber(string $number)

Parameters

string $number

Return Value

Order