Skip to content

Schema ​

Namespace: Unusualify\Modularous\Repositories\Logic\Schema

Manages the active input schema for a repository operation and provides helpers to chunk inputs into flat arrays. Composes ManageTraits.

Properties ​

PropertyTypeDescription
$schemaarray|nullThe overriding schema set for the current operation. When null, inputs() is used.

Methods ​

MethodSignatureDescription
setSchema(?array $schema): voidOverrides the active schema for the duration of the current operation (e.g., a specific form context)
getSchema(): array|nullReturns the currently active overriding schema
getInputs(): arrayReturns $schema if set, otherwise falls back to $this->inputs()
getRawInputs(): arrayAlways returns $this->inputs() — ignores any $schema override
getRawChunkedInputs(bool $all, bool $noGroupChunk): arrayChunks getRawInputs() via chunkInputs()
getChunkedInputs(bool $all, bool $noGroupChunk): arrayChunks getInputs() (respects $schema override) via chunkInputs()

Chunking Behaviour ​

chunkInputs() flattens the inputs array into a single-level associative array keyed by input name. The $all flag includes inputs that are normally hidden (e.g. conditional inputs). The $noGroupChunk flag prevents group-level chunking, returning all inputs regardless of group boundaries.

Usage ​

php
// Temporarily override schema for a specific operation
$repo->setSchema($customSchema);
$fields = $repo->getFormFields($object);
$repo->setSchema(null); // restore

// Get all chunked inputs for column detection
$inputs = $repo->getRawChunkedInputs(all: true);