DataCollectableFactory
class DataCollectableFactory
Methods
Extract keyed items from a supported collection value.
Rebuild normalized items in the source shape used by collection factories.
Rebuild normalized items in an explicit or source-inferred target.
Retain the source needed to rebuild one paginated property.
Rebuild typed items in a property's declared container.
Rebuild an eager enumerable in its declared collection class.
Clone the retained paginator and replace only its items.
Clone the retained cursor paginator and replace only its items.
Rebuild normalized items in their supported root source shape.
Clone an offset paginator source with normalized items.
Clone a cursor paginator source with normalized items.
Determine if normalized items can safely retain the root source shape.
Details
at line 33
array|null
items(mixed $value)
Extract keyed items from a supported collection value.
at line 59
mixed
forMethodSource(string $dataClass, mixed $source, array|Enumerable $items)
Rebuild normalized items in the source shape used by collection factories.
Contract-only paginators intentionally have no method-dispatch shape because their metadata cannot be cloned without mutating an unknown implementation.
at line 77
mixed
forTarget(string $dataClass, mixed $source, array|Enumerable $items, string|null $into)
Rebuild normalized items in an explicit or source-inferred target.
at line 146
void
retainPaginatorSource(NamedType $type, mixed $value, ConstructionState $state)
Retain the source needed to rebuild one paginated property.
at line 195
mixed
forProperty(NamedType $type, array $items, ConstructionState $state)
Rebuild typed items in a property's declared container.
at line 230
protected Enumerable
newEnumerable(string $class, array $items)
Rebuild an eager enumerable in its declared collection class.
at line 248
protected AbstractPaginator
paginator(NamedType $type, array $items, ConstructionState $state)
Clone the retained paginator and replace only its items.
at line 267
protected AbstractCursorPaginator
cursorPaginator(NamedType $type, array $items, ConstructionState $state)
Clone the retained cursor paginator and replace only its items.
at line 287
protected mixed
rebuildRoot(string $dataClass, mixed $source, array|Enumerable $items)
Rebuild normalized items in their supported root source shape.
at line 333
protected AbstractPaginator
rebuildPaginator(mixed $source, array|Enumerable $items, string $into)
Clone an offset paginator source with normalized items.
at line 354
protected AbstractCursorPaginator
rebuildCursorPaginator(mixed $source, array|Enumerable $items, string $into)
Clone a cursor paginator source with normalized items.
at line 376
protected array
eagerItems(array|Enumerable $items)
Materialize normalized items without changing their keys.
at line 384
protected bool
canRebuildRoot(mixed $source)
Determine if normalized items can safely retain the root source shape.