SlotFlow API Documentation

QuantityStateBatch
in package

Group of per-subject quantity states to be processed by the batch engine.

Tags
template
psalm-import-type

TSlotPattern from SlotSpace

psalm-import-type

TSlotValues from SlotSpace

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

Methods

__construct()

public __construct(array<string|int, BatchItem$items) : mixed
Parameters
$items : array<string|int, BatchItem>
Tags
psalm-param

array<BatchItem<TSubject>> $items

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
psalm-template

TRow

psalm-template

TFactorySubject

psalm-param

iterable<TRow> $rows

psalm-param

\Closure(TRow): TFactorySubject $subjectGetter

psalm-param

\Closure(TRow): list<array{0: Slot|TSlotValues, 1: int, 2?: array<string, mixed>}> $slotRowGetter

psalm-param

\Closure(list<TRow>): int $quantityGetter

psalm-param

?\Closure(TFactorySubject): non-empty-string $subjectIdGetter

psalm-return

self<TFactorySubject>

Return values
self

items()

Return the batch items in subject order.

public items() : array<string|int, BatchItem>
Tags
psalm-return

array<BatchItem<TSubject>>

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}>
Tags
psalm-return

array<array{subject: TSubject, result: MovementResult|null}>

Return values
array<string|int, MovementResult|null}>

        
On this page

Search results