QuantityStateBatch
in package
Group of per-subject quantity states to be processed by the batch engine.
Tags
Table of Contents
Properties
- $items : array<string|int, mixed>
Methods
- __construct() : mixed
- deltas() : array<int, BatchQuantityStateDelta<string|int, TSubject>>
- Flatten all item results to batch-scoped quantity-state deltas.
- fromRows() : self
- Creates a QuantityStateBatch from an iterable of rows, using the provided closures to extract the necessary information.
- items() : array<string|int, BatchItem>
- Return the batch items in subject order.
- ledgerEntries() : array<int, BatchLedgerEntry<string|int, TSubject>>
- Flatten all item results to batch-scoped ledger entries.
- results() : array<string|int, MovementResult|null}>
- Returns the movement results for each item in the batch.
Properties
$items
private
array<string|int, mixed>
$items
Methods
__construct()
public
__construct(array<string|int, BatchItem> $items) : mixed
Parameters
- $items : array<string|int, BatchItem>
Tags
deltas()
Flatten all item results to batch-scoped quantity-state deltas.
public
deltas() : array<int, BatchQuantityStateDelta<string|int, TSubject>>
Return values
array<int, BatchQuantityStateDelta<string|int, TSubject>>fromRows()
Creates a QuantityStateBatch from an iterable of rows, using the provided closures to extract the necessary information.
public
static fromRows(SlotSpace $space, iterable<string|int, mixed> $rows, Closure $subjectGetter, Closure $slotRowGetter, Closure $quantityGetter, Closure|null $subjectIdGetter) : self
Parameters
- $space : SlotSpace
- $rows : iterable<string|int, mixed>
- $subjectGetter : Closure
-
closure to get the subject from a row
- $slotRowGetter : Closure
-
closure to resolve slot dimensions and quantity from a row
- $quantityGetter : Closure
-
closure to get quantity from rows belonging to the same subject
- $subjectIdGetter : Closure|null
-
optional closure to get subject id from a row
Tags
Return values
selfitems()
Return the batch items in subject order.
public
items() : array<string|int, BatchItem>
Tags
Return values
array<string|int, BatchItem>ledgerEntries()
Flatten all item results to batch-scoped ledger entries.
public
ledgerEntries([array<string, mixed> $context = [] ]) : array<int, BatchLedgerEntry<string|int, TSubject>>
Parameters
- $context : array<string, mixed> = []
Return values
array<int, BatchLedgerEntry<string|int, TSubject>>results()
Returns the movement results for each item in the batch.
public
results() : array<string|int, MovementResult|null}>