OrderWriteService
in package
implements
OrderWriteServiceInterface
Class OrderWriteService
Tags
Interfaces, Classes and Traits
- OrderWriteServiceInterface
- Interface OrderWriteServiceInterface
Table of Contents
- $deleteHistoryService : DeleteHistoryWriteService
- $orderItemAttributeRepositoryFactory : OrderItemAttributeRepositoryFactory
- $orderItemRepository : OrderItemRepository
- $orderRepository : OrderRepository
- $orderServiceSettings : OrderServiceSettingsInterface
- $orderStatusHistoryStorage : OrderStatusHistoryStorage
- $orderTotalRepository : OrderTotalRepository
- __construct() : mixed
- Class Constructor
- addOrderItem() : int
- Add Order Item
- addOrderItemAttribute() : int
- Add Order Item Attribute
- addOrderStatusHistoryEntry() : mixed
- Add Order Status History Entry
- addOrderTotal() : int
- Add Order Total
- createNewCustomerOrder() : int
- Create New Customer Order
- createNewStandaloneOrder() : int
- Create New Standalone Order
- removeOrderById() : mixed
- Remove Order by ID
- removeOrderItem() : mixed
- Remove Order Item
- removeOrderItemAttribute() : mixed
- Remove Order Item Attribute
- removeOrderTotal() : mixed
- Remove Order Total
- updateBillingAddress() : mixed
- Update Billing Address
- updateComment() : mixed
- Update Comment
- updateCustomerAddress() : mixed
- Update Customer Address
- updateDeliveryAddress() : mixed
- Update Delivery Address
- updateOrder() : OrderWriteService
- Update Order
- updateOrderItem() : mixed
- Update Order Item
- updateOrderItemAttribute() : mixed
- Update Order Item Attribute
- updateOrderStatus() : mixed
- Update Order Status
- updateOrderTotal() : mixed
- Update Order Total
- updatePaymentType() : mixed
- Update Payment Type
- updateShippingType() : mixed
- Update Shipping Type
Properties
$deleteHistoryService
protected
DeleteHistoryWriteService
$deleteHistoryService
$orderItemAttributeRepositoryFactory
protected
OrderItemAttributeRepositoryFactory
$orderItemAttributeRepositoryFactory
$orderItemRepository
protected
OrderItemRepository
$orderItemRepository
$orderRepository
protected
OrderRepository
$orderRepository
$orderServiceSettings
protected
OrderServiceSettingsInterface
$orderServiceSettings
$orderStatusHistoryStorage
protected
OrderStatusHistoryStorage
$orderStatusHistoryStorage
$orderTotalRepository
protected
OrderTotalRepository
$orderTotalRepository
Methods
__construct()
Class Constructor
public
__construct(OrderRepositoryInterface $orderRepository, OrderItemRepositoryInterface $orderItemRepository, OrderItemAttributeRepositoryFactoryInterface $orderItemAttributeRepositoryFactory, OrderTotalRepository $orderTotalRepository, OrderStatusHistoryStorage $orderStatusHistoryWriter, OrderServiceSettingsInterface $orderServiceSetting, DeleteHistoryWriteService $deleteHistoryService) : mixed
Parameters
- $orderRepository : OrderRepositoryInterface
- $orderItemRepository : OrderItemRepositoryInterface
- $orderItemAttributeRepositoryFactory : OrderItemAttributeRepositoryFactoryInterface
- $orderTotalRepository : OrderTotalRepository
- $orderStatusHistoryWriter : OrderStatusHistoryStorage
- $orderServiceSetting : OrderServiceSettingsInterface
- $deleteHistoryService : DeleteHistoryWriteService
Return values
mixed —addOrderItem()
Add Order Item
public
addOrderItem(IdType $orderId, OrderItemInterface $orderItem) : int
Adds an item to the order.
Parameters
- $orderId : IdType
-
Order ID of the order to add the item
- $orderItem : OrderItemInterface
-
The order item to add
Return values
int —Id of the StoredOrderItem
addOrderItemAttribute()
Add Order Item Attribute
public
addOrderItemAttribute(IdType $orderItemId, OrderItemAttributeInterface $orderItemAttribute) : int
Adds an order item attribute to the order
Parameters
- $orderItemId : IdType
-
Order ID of the order item to add the attribute.
- $orderItemAttribute : OrderItemAttributeInterface
-
The order item attribute to add
Return values
int —Id of stored order item attribute.
addOrderStatusHistoryEntry()
Add Order Status History Entry
public
addOrderStatusHistoryEntry(IdType $orderId, StringType $comment, IdType $customerId) : mixed
Add an order status history entry to an order, without changing the status or notifying the customer.
Parameters
- $orderId : IdType
-
Order ID of the order to update
- $comment : StringType
-
Comment of the order status history item
- $customerId : IdType
-
Customer ID of the admin
Return values
mixed —addOrderTotal()
Add Order Total
public
addOrderTotal(IdType $orderId, OrderTotalInterface $orderTotal) : int
Adds a total price to an order.
Parameters
- $orderId : IdType
-
Order Id of the order to add the total price
- $orderTotal : OrderTotalInterface
-
Total price to add to the order
Return values
int —Id of stored order total.
createNewCustomerOrder()
Create New Customer Order
public
createNewCustomerOrder(IdType $customerId, CustomerStatusInformation $customerStatusInfo, StringType $customerNumber, EmailStringType $customerEmail, StringType $customerTelephone, StringType $vatIdNumber, AddressBlockInterface $customerAddress, AddressBlockInterface $billingAddress, AddressBlockInterface $deliveryAddress, OrderItemCollection $orderItemCollection, OrderTotalCollection $orderTotalCollection, OrderShippingType $shippingType, OrderPaymentType $paymentType, CurrencyCode $currencyCode, LanguageCode $languageCode, DecimalType $totalWeight[, StringType $comment = null ][, IntType $orderStatusId = null ][, KeyValueCollection $addonValues = null ]) : int
Creates a new customer order and returns the order ID as an integer.
Parameters
- $customerId : IdType
-
Customer ID
- $customerStatusInfo : CustomerStatusInformation
-
Customer Status Information
- $customerNumber : StringType
-
Customer Number
- $customerEmail : EmailStringType
-
Customer Email
- $customerTelephone : StringType
-
Customer Telephone
- $vatIdNumber : StringType
-
VAT ID Number
- $customerAddress : AddressBlockInterface
-
Address of the customer
- $billingAddress : AddressBlockInterface
-
Billing address of the customer
- $deliveryAddress : AddressBlockInterface
-
Delivery address of the customer
- $orderItemCollection : OrderItemCollection
-
Collection of the order items
- $orderTotalCollection : OrderTotalCollection
-
Total collection of the order
- $shippingType : OrderShippingType
-
Shipping type of the order
- $paymentType : OrderPaymentType
-
Payment type of the order
- $currencyCode : CurrencyCode
-
Currency code of the order
- $languageCode : LanguageCode
-
Language code of the order
- $totalWeight : DecimalType
-
Total weight of the order in kilo gram
- $comment : StringType = null
-
Optional comment of the order (default = null)
- $orderStatusId : IntType = null
-
Optional id of the initial order status (default = null)
- $addonValues : KeyValueCollection = null
-
Optional key => value collection of addon values - e.g. cookies (default = null)
Return values
int —createNewStandaloneOrder()
Create New Standalone Order
public
createNewStandaloneOrder(StringType $customerNumber, EmailStringType $customerEmail, StringType $customerTelephone, StringTYpe $vatIdNumber, AddressBlockInterface $customerAddress, AddressBlockInterface $billingAddress, AddressBlockInterface $deliveryAddress, OrderItemCollection $orderItemCollection, OrderTotalCollection $orderTotalCollection, OrderShippingType $shippingType, OrderPaymentType $paymentType, CurrencyCode $currencyCode, LanguageCode $languageCode, DecimalType $totalWeight[, StringType $comment = null ][, IntType $orderStatusId = null ][, KeyValueCollection $addonValues = null ]) : int
Creates a new standalone order (e.g. for guests) and returns the order ID as an integer.
Parameters
- $customerNumber : StringType
-
Customer Number
- $customerEmail : EmailStringType
-
Customer Email
- $customerTelephone : StringType
-
Customer Telephone
- $vatIdNumber : StringTYpe
-
VAT ID number of the customer.
- $customerAddress : AddressBlockInterface
-
Address of the customer
- $billingAddress : AddressBlockInterface
-
Billing address of the customer
- $deliveryAddress : AddressBlockInterface
-
Delivery address of the customer
- $orderItemCollection : OrderItemCollection
-
Collection of the order items
- $orderTotalCollection : OrderTotalCollection
-
Total collection of the order
- $shippingType : OrderShippingType
-
Shipping type of the order
- $paymentType : OrderPaymentType
-
Payment type of the order
- $currencyCode : CurrencyCode
-
Currency code of the order
- $languageCode : LanguageCode
-
Language code of the order
- $totalWeight : DecimalType
-
Total weight of the order in kg.
- $comment : StringType = null
-
Optional comment of the order (default = null)
- $orderStatusId : IntType = null
-
Optional id of the initial order status (default = null)
- $addonValues : KeyValueCollection = null
-
Optional key => value collection of addon values - e.g. cookies (default = null)
Return values
int —removeOrderById()
Remove Order by ID
public
removeOrderById(IdType $orderId) : mixed
Removes a specific order, depending on the provided order ID.
Parameters
- $orderId : IdType
-
Order ID of the order to remove
Return values
mixed —removeOrderItem()
Remove Order Item
public
removeOrderItem(StoredOrderItemInterface $orderItem) : mixed
Removes an item from an order.
Parameters
- $orderItem : StoredOrderItemInterface
-
The order item to remove
Return values
mixed —removeOrderItemAttribute()
Remove Order Item Attribute
public
removeOrderItemAttribute(StoredOrderItemAttributeInterface $orderItemAttribute) : mixed
Removes an item attribute of an order
Parameters
- $orderItemAttribute : StoredOrderItemAttributeInterface
-
The order item attribute to remove
Return values
mixed —removeOrderTotal()
Remove Order Total
public
removeOrderTotal(StoredOrderTotalInterface $orderTotal) : mixed
Removes a total price of an order
Parameters
- $orderTotal : StoredOrderTotalInterface
-
The total price of an order to remove
Return values
mixed —updateBillingAddress()
Update Billing Address
public
updateBillingAddress(IdType $orderId, AddressBlockInterface $newAddress) : mixed
Updates the customers billing address.
Parameters
- $orderId : IdType
-
Order ID which holds the current address
- $newAddress : AddressBlockInterface
-
New billing address
Return values
mixed —updateComment()
Update Comment
public
updateComment(IdType $orderId, StringType $newComment) : mixed
Updates the comment of an order.
Parameters
- $orderId : IdType
-
Order ID of the order to update
- $newComment : StringType
-
The new comment
Return values
mixed —updateCustomerAddress()
Update Customer Address
public
updateCustomerAddress(IdType $orderId, AddressBlockInterface $newAddress) : mixed
Updates the customers address.
Parameters
- $orderId : IdType
-
Order ID which holds the current address
- $newAddress : AddressBlockInterface
-
New address of the customer
Return values
mixed —updateDeliveryAddress()
Update Delivery Address
public
updateDeliveryAddress(IdType $orderId, AddressBlockInterface $newAddress) : mixed
Updates the customers delivery address.
Parameters
- $orderId : IdType
-
Order ID which holds the current address
- $newAddress : AddressBlockInterface
-
New delivery address
Return values
mixed —updateOrder()
Update Order
public
updateOrder(OrderInterface $order) : OrderWriteService
Updates the provided order.
Parameters
- $order : OrderInterface
-
Order to update
Return values
OrderWriteService —Same instance for chained method calls.
updateOrderItem()
Update Order Item
public
updateOrderItem(StoredOrderItemInterface $orderItem) : mixed
Updates an order item.
Parameters
- $orderItem : StoredOrderItemInterface
-
The order item to update
Return values
mixed —updateOrderItemAttribute()
Update Order Item Attribute
public
updateOrderItemAttribute(StoredOrderItemAttributeInterface $orderItemAttribute) : mixed
Updates an item attribute of an order.
Parameters
- $orderItemAttribute : StoredOrderItemAttributeInterface
-
The order item attribute to update
Return values
mixed —updateOrderStatus()
Update Order Status
public
updateOrderStatus(IdType $orderId, IntType $newOrderStatusId, StringType $comment, BoolType $customerNotified[, IdType|null $customerId = null ]) : mixed
Updates the order status of an order.
Parameters
- $orderId : IdType
-
Order ID of the order to update
- $newOrderStatusId : IntType
-
The new status Id
- $comment : StringType
-
Comment of the order status history item
- $customerNotified : BoolType
-
Customer notified flag
- $customerId : IdType|null = null
-
Customer ID of the admin account
Return values
mixed —updateOrderTotal()
Update Order Total
public
updateOrderTotal(StoredOrderTotalInterface $orderTotal) : mixed
Updates a total price of an order
Parameters
- $orderTotal : StoredOrderTotalInterface
-
The total price of an order to update
Return values
mixed —updatePaymentType()
Update Payment Type
public
updatePaymentType(IdType $orderId, OrderPaymentType $newPaymentType) : mixed
Updates the payment type of an order.
Parameters
- $orderId : IdType
-
Order ID of the order to update
- $newPaymentType : OrderPaymentType
-
The new payment type
Return values
mixed —updateShippingType()
Update Shipping Type
public
updateShippingType(IdType $orderId, OrderShippingType $newShippingType) : mixed
Updates the shipping type of an order.
Parameters
- $orderId : IdType
-
Order ID of the order to update
- $newShippingType : OrderShippingType
-
The new shipping type