OrderItemRepositoryReader

Implements \OrderItemRepositoryReaderInterface

Class OrderItemRepositoryReader

category

System

package

Order

subpackage

Repositories

Methods

OrderItemRepositoryReader constructor.

__construct(\CI_DB_query_builder $db, \OrderItemFactoryInterface $orderItemFactory) 

Arguments

$db

\CI_DB_query_builder

Query builder.

$orderItemFactory

\OrderItemFactoryInterface

Order item factory.

Parse download information of order item.

_parseOrderItemDownloads(array $downloads) : \OrderItemDownloadInformationCollection
Throws
\InvalidArgumentException

Arguments

$downloads

array

Contains the records of the "orders_products_download" table that are related to the order item.

Response

\OrderItemDownloadInformationCollection

Returns a collection with the OrderItemDownload instances.

Parse gx customizer data of order item.

_parseOrderItemGXCustomizerData(array $gxCustomizerData) : \OrderItemGXCustomizerDataCollection

Arguments

$gxCustomizerData

array

Contains the records of the "gm_gprint_orders_elements", "gm_gprint_orders_surfaces" and "gm_gprint_orders_surfaces_groups" table that are related to the order item.

Response

\OrderItemGXCustomizerDataCollection

Assign via the setter the StoredOrderItem values.

_setDbValues(\StoredOrderItemInterface $storedOrderItem, array $row) 
Throws
\InvalidArgumentException

If $row contains invalid values.

Arguments

$storedOrderItem

\StoredOrderItemInterface

$row

array

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

getItemById(\IdType $orderItemId) : \StoredOrderItemInterface
Throws
\UnexpectedValueException

If no order item entry has been found.

\InvalidArgumentException

If download information contain invalid values.

Arguments

$orderItemId

\IdType

ID of order item.

Response

\StoredOrderItemInterface

Fetched order item.

Returns a collection of stored order items by the given order ID.

getItemsByOrderId(\IdType $orderId) : \StoredOrderItemCollection
Throws
\InvalidArgumentException

If the database record contains invalid values.

Arguments

$orderId

\IdType

ID of the order.

Response

\StoredOrderItemCollection

Fetched order item collection.

Properties

Query builder.

db : \CI_DB_query_builder
var

Type(s)

\CI_DB_query_builder

Order item factory.

orderItemFactory : \OrderItemFactoryInterface