The facet forward-exit of model discovery.
Discovery derives a column's facets from the table schema (Nullable, Precision/Scale,
MaxLength). Some facets are not a fact of the column but of the installation: a unit price
stored as decimal(19,6) is announced with the installation's price decimals. A host or
package that knows such a fact binds its own resolver; the default
({@see \LaravelUi5\OData\Service\Discovery\ColumnFacetsAsDeclared}) returns the facets unchanged.
Order per column: the schema's facets → this resolver → #[ODataProperty(precision:, scale:, nullable:)]. The attribute is local to one model and wins.
The resolver runs when the schema is built — on every request for a cold service, once in
odata:cache for a cached one. A cached service keeps the value it saw then; when the fact
changes, the cache must be rebuilt.
One binding, not a chain: rebinding replaces the previous resolver. A package that wants to keep another resolver's answer decorates it.
| Methods | ||
|---|---|---|
public
|
resolve(class-string<Model> $modelClass, string $column, string|null $cast, TypeFacets $facets): TypeFacets
|
# |