SlotFlow API Documentation

PolicyBuckets
in package

FinalYes

Routes mixed policy bags into the typed buckets used by execution and planning.

Table of Contents

Constants

ALL  : mixed = 'policies'
ALLOCATION  : mixed = 'allocation-policies'
FILTER  : mixed = 'filter-policies'
ORDERING  : mixed = 'ordering-policies'
PLANNER  : mixed = 'planner-policies'
QUANTITY_CONSTRAINT  : mixed = 'quantity-constraint-policies'
SHIPMENT_CALENDAR  : mixed = 'shipment-calendar-rules'
SHIPMENT_SPLIT  : mixed = 'shipment-split-rules'

Methods

all()  : array<int, PolicyInterface>
applyToStep()  : void
Apply a mixed policy bag to a flow step.
matchesAny()  : bool
mergeEdgeAttributes()  : array<string|int, mixed>
Attach planner-capable policies to one edge-rule metadata array.
planner()  : array<int, PlannerRuleInterface>
resolveCategory()  : array<int, TPolicy>
Resolve one typed category out of a raw policy sequence, applying named overrides.
shipmentCalendar()  : array<int, ShipmentCalendarRuleInterface>
shipmentSplit()  : array<int, ShipmentSplitRuleInterface>
mergeCategory()  : array<int, TBucketEntry>
Rebuild one typed bucket from the step's policy bag without discarding what was declared through the dedicated builder methods.
unwrap()  : PolicyInterface}

Constants

QUANTITY_CONSTRAINT

public mixed QUANTITY_CONSTRAINT = 'quantity-constraint-policies'

SHIPMENT_CALENDAR

public mixed SHIPMENT_CALENDAR = 'shipment-calendar-rules'

SHIPMENT_SPLIT

public mixed SHIPMENT_SPLIT = 'shipment-split-rules'

Methods

applyToStep()

Apply a mixed policy bag to a flow step.

public static applyToStep(FlowStep $step, array<string|int, PolicyInterface$policies) : void
Parameters
$step : FlowStep
$policies : array<string|int, PolicyInterface>

mergeEdgeAttributes()

Attach planner-capable policies to one edge-rule metadata array.

public static mergeEdgeAttributes(array<string|int, mixed> $attributes, array<string|int, PolicyInterface$policies) : array<string|int, mixed>
Parameters
$attributes : array<string|int, mixed>
$policies : array<string|int, PolicyInterface>
Return values
array<string|int, mixed>

resolveCategory()

Resolve one typed category out of a raw policy sequence, applying named overrides.

public static resolveCategory(array<string|int, PolicyInterface$policies, callable(PolicyInterface): bool $matches) : array<int, TPolicy>
Parameters
$policies : array<string|int, PolicyInterface>
$matches : callable(PolicyInterface): bool
Tags
template
Return values
array<int, TPolicy>

mergeCategory()

Rebuild one typed bucket from the step's policy bag without discarding what was declared through the dedicated builder methods.

private static mergeCategory(array<int, TBucketEntry$bucket, array<string|int, PolicyInterface$policies, callable(PolicyInterface): bool $matches) : array<int, TBucketEntry>

A step can be configured two ways: orderBy() / filter() / constraint() / allocate() write straight into a typed bucket, while policies() appends to the untyped bag the buckets are derived from. Recomputing a bucket purely from the bag therefore used to erase whatever the first route had put there — silently, so a flow that declared an ordering and then called policies() ran with no ordering at all and simply produced a different movement.

Entries already derived from the bag are matched by identity and replaced, so calling policies() repeatedly re-derives rather than duplicates; anything else in the bucket came from a builder method and is kept.

The two routes order their own kind differently, and that predates this method: orderBy() unshifts, so an earlier declaration wins, while policies() appends, so a later one wins. Keeping bucket-declared entries first preserves both conventions exactly as they were rather than quietly imposing one on the other.

Parameters
$bucket : array<int, TBucketEntry>
$policies : array<string|int, PolicyInterface>
$matches : callable(PolicyInterface): bool
Tags
template
Return values
array<int, TBucketEntry>
On this page

Search results