OrderItemRepository

Implements \OrderItemRepositoryInterface

Class OrderItemRepository

category

System

package

Order

subpackage

Repositories

Methods

OrderItemRepository constructor.

__construct(\OrderItemAttributeRepositoryFactoryInterface $orderItemAttributeRepositoryFactory, \OrderItemRepositoryReaderInterface $orderItemRepositoryReader, \OrderItemRepositoryWriterInterface $orderItemRepositoryWriter, \OrderItemRepositoryDeleterInterface $orderItemRepositoryDeleter, \AddonValueServiceInterface $addonValueService) 

Arguments

$orderItemAttributeRepositoryFactory

\OrderItemAttributeRepositoryFactoryInterface

Factory to create order item attribute repositories.

$orderItemRepositoryReader

\OrderItemRepositoryReaderInterface

Db reader for order item repository.

$orderItemRepositoryWriter

\OrderItemRepositoryWriterInterface

Db writer for order item repository.

$orderItemRepositoryDeleter

\OrderItemRepositoryDeleterInterface

Db deleter for order item repository.

$addonValueService

\AddonValueServiceInterface

Addon value service.

Delegate to the attribute repository and save the attributes of the passed order item.

_delegateToAttributeRepositories(\OrderItemInterface $orderItem, integer|null $storedOrderItemId = null) : $this

Arguments

$orderItem

\OrderItemInterface

Order item which contain the attributes.

$storedOrderItemId

integer|null

(Optional) Id of order item. When not set, its get by stored order item.

Response

$this

Same instance to make chained method calls possible.

Adds an order item to the order item repository.

addToOrder(\IdType $orderId, \OrderItemInterface $orderItem) : integer

Arguments

$orderId

\IdType

Order ID.

$orderItem

\OrderItemInterface

Order item to add.

Response

integer

ID of the StoredOrderItem

Deletes an order item from the repository by the given order item ID.

deleteItemById(\IdType $orderItemId) : \OrderItemRepository

Arguments

$orderItemId

\IdType

Order item ID.

Response

\OrderItemRepository

Same instance for method chaining.

Deletes order items from the repository by the given order ID.

deleteItemsByOrderId(\IdType $orderId) : \OrderItemRepository

Arguments

$orderId

\IdType

Order ID.

Response

\OrderItemRepository

Same instance for method chaining.

Returns a stored order ID by the given order item ID.

getItemById(\IdType $orderItemId) : \StoredOrderItemInterface

Arguments

$orderItemId

\IdType

ID of the stored order item.

Response

\StoredOrderItemInterface

Stored order item.

Returns a stored order item collection by the given order ID.

getItemsByOrderId(\IdType $orderId) : \StoredOrderItemCollection

Arguments

$orderId

\IdType

ID of the order.

Response

\StoredOrderItemCollection

Stored order item collection.

Saves the order item in the repository.

store(\StoredOrderItemInterface $storedOrderItem) : \OrderItemRepository

Arguments

$storedOrderItem

\StoredOrderItemInterface

Order item to save.

Response

\OrderItemRepository

Same instance for method chaining.

Properties

Order item attribute repository factory.

orderItemAttributeRepositoryFactory : \OrderItemAttributeRepositoryFactoryInterface

Order item repository reader.

orderItemRepositoryReader : \OrderItemRepositoryReaderInterface

Order item repository writer.

orderItemRepositoryWriter : \OrderItemRepositoryWriterInterface

Order item repository deleter.

orderItemRepositoryDeleter : \OrderItemRepositoryDeleterInterface

Addon value service.

addonValueService : \AddonValueServiceInterface