Skip to content
docsv0.24.0

FieldParser

Parses the `--fields` DSL (`name:type[:mods]`, comma-separated; leading `?` = nullable) into a list of {@see FieldSpec}. Supports scalars (+ length / precision,scale mods), `enum:<Enum>`, and `<name>:belongsTo:<Target>` for callers that can honor or deliberately degrade a relation token. Runtime entity callers pass `supportsRelations: false`, which removes that token from unknown-type suggestions and routes every explicit relation token to the scalar-first refusal.

FieldParser::parse()

public function parse(string $dsl, bool $supportsRelations = true): array

Parses the full `--fields` DSL string into a list of {@see FieldSpec}.

Parameters

Parameters of parse()
NameTypeDescription
$dslstring
$supportsRelationsboolWhether the caller can honor a `belongsTo:<Entity>` token