OrderItemRepository
in package
implements
OrderItemRepositoryInterface
Class OrderItemRepository
Tags
Interfaces, Classes and Traits
- OrderItemRepositoryInterface
- Interface OrderItemRepositoryInterface
Table of Contents
- $addonValueService : AddonValueServiceInterface
- Addon value service.
- $orderItemAttributeRepositoryFactory : OrderItemAttributeRepositoryFactoryInterface
- Order item attribute repository factory.
- $orderItemRepositoryDeleter : OrderItemRepositoryDeleterInterface
- Order item repository deleter.
- $orderItemRepositoryReader : OrderItemRepositoryReaderInterface
- Order item repository reader.
- $orderItemRepositoryWriter : OrderItemRepositoryWriterInterface
- Order item repository writer.
- __construct() : mixed
- OrderItemRepository constructor.
- addToOrder() : int
- Adds an order item to the order item repository.
- deleteItemById() : OrderItemRepository
- Deletes an order item from the repository by the given order item ID.
- deleteItemsByOrderId() : OrderItemRepository
- Deletes order items from the repository by the given order ID.
- getItemById() : StoredOrderItemInterface
- Returns a stored order ID by the given order item ID.
- getItemsByOrderId() : StoredOrderItemCollection
- Returns a stored order item collection by the given order ID.
- store() : OrderItemRepository
- Saves the order item in the repository.
- _delegateToAttributeRepositories() : $this
- Delegate to the attribute repository and save the attributes of the passed order item.
Properties
$addonValueService
Addon value service.
protected
AddonValueServiceInterface
$addonValueService
$orderItemAttributeRepositoryFactory
Order item attribute repository factory.
protected
OrderItemAttributeRepositoryFactoryInterface
$orderItemAttributeRepositoryFactory
$orderItemRepositoryDeleter
Order item repository deleter.
protected
OrderItemRepositoryDeleterInterface
$orderItemRepositoryDeleter
$orderItemRepositoryReader
Order item repository reader.
protected
OrderItemRepositoryReaderInterface
$orderItemRepositoryReader
$orderItemRepositoryWriter
Order item repository writer.
protected
OrderItemRepositoryWriterInterface
$orderItemRepositoryWriter
Methods
__construct()
OrderItemRepository constructor.
public
__construct(OrderItemAttributeRepositoryFactoryInterface $orderItemAttributeRepositoryFactory, OrderItemRepositoryReaderInterface $orderItemRepositoryReader, OrderItemRepositoryWriterInterface $orderItemRepositoryWriter, OrderItemRepositoryDeleterInterface $orderItemRepositoryDeleter, AddonValueServiceInterface $addonValueService) : mixed
Parameters
- $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.
Return values
mixed —addToOrder()
Adds an order item to the order item repository.
public
addToOrder(IdType $orderId, OrderItemInterface $orderItem) : int
Parameters
- $orderId : IdType
-
Order ID.
- $orderItem : OrderItemInterface
-
Order item to add.
Return values
int —ID of the StoredOrderItem
deleteItemById()
Deletes an order item from the repository by the given order item ID.
public
deleteItemById(IdType $orderItemId) : OrderItemRepository
Parameters
- $orderItemId : IdType
-
Order item ID.
Return values
OrderItemRepository —Same instance for method chaining.
deleteItemsByOrderId()
Deletes order items from the repository by the given order ID.
public
deleteItemsByOrderId(IdType $orderId) : OrderItemRepository
Parameters
- $orderId : IdType
-
Order ID.
Return values
OrderItemRepository —Same instance for method chaining.
getItemById()
Returns a stored order ID by the given order item ID.
public
getItemById(IdType $orderItemId) : StoredOrderItemInterface
Parameters
- $orderItemId : IdType
-
ID of the stored order item.
Return values
StoredOrderItemInterface —Stored order item.
getItemsByOrderId()
Returns a stored order item collection by the given order ID.
public
getItemsByOrderId(IdType $orderId) : StoredOrderItemCollection
Parameters
- $orderId : IdType
-
ID of the order.
Return values
StoredOrderItemCollection —Stored order item collection.
store()
Saves the order item in the repository.
public
store(StoredOrderItemInterface $storedOrderItem) : OrderItemRepository
Parameters
- $storedOrderItem : StoredOrderItemInterface
-
Order item to save.
Return values
OrderItemRepository —Same instance for method chaining.
_delegateToAttributeRepositories()
Delegate to the attribute repository and save the attributes of the passed order item.
protected
_delegateToAttributeRepositories(OrderItemInterface $orderItem[, int|null $storedOrderItemId = null ]) : $this
Parameters
- $orderItem : OrderItemInterface
-
Order item which contain the attributes.
- $storedOrderItemId : int|null = null
-
(Optional) Id of order item. When not set, its get by stored order item.
Return values
$this —Same instance to make chained method calls possible.