OrderStatusHistoryReader
in package
Class OrderStatusHistoryReader
Table of Contents
- $connection : Connection
- $orderStatusHistoryCache : array<string|int, mixed>
- __construct() : mixed
- OrderStatusHistoryReader constructor.
- fetchHistoryFor() : array<string|int, mixed>
- Fetches the order status history for the given order id.
Properties
$connection
private
Connection
$connection
$orderStatusHistoryCache
private
array<string|int, mixed>
$orderStatusHistoryCache
= []
Methods
__construct()
OrderStatusHistoryReader constructor.
public
__construct(Connection $connection) : mixed
Parameters
- $connection : Connection
Return values
mixed —fetchHistoryFor()
Fetches the order status history for the given order id.
public
fetchHistoryFor(OrderId $orderId) : array<string|int, mixed>
The entries are ordered by the field 'date_added' descending.
There are two cases where this method might throw an exception.
The obvious case is if the given order id is not associated with any order, and therefore
has no entries in the history table. An OrderPaidStatusNotFoundException exception is thrown in this case.
In the unlikely event that the database connection is faulty, an OrderStatusDataCorruptedException is
thrown, but this is an edge case which usually should never happen.
Parameters
- $orderId : OrderId