Class LaravelUi5\OData\Protocol\Execution\RowCoercion

final
readonly

Coerces row values to OData v4 wire formats at JSON emission time.

Two property kinds get coerced:

Temporal primitives — MySQL DATETIME/DATE/TIME columns accessed via raw query builder yield strings like 2026-05-05 12:34:56 (no T, no offset), which is not a valid Edm.DateTimeOffset literal (RFC 3339 §5.6 mandates T and a Z/numeric offset) and breaks Date.parse() in Safari. Coercion uses Carbon: - Edm.DateTimeOffset → Carbon::parse($v)->toRfc3339String() - Edm.Date → Carbon::parse($v)->toDateString() (Y-m-d) - Edm.TimeOfDay → Carbon::parse($v)->format('H:i:s') Already-correct strings round-trip cleanly.

EnumType properties — backing-int values are projected to the symbolic member name on the wire (tier: 1 → tier: "Single"), the short form that sap.ui.model.odata.type.Enum parses by default. Unknown ints pass through unchanged so schema drift is visible rather than masked.

Booleans and numbers — drivers return what the column stores, not what the property declares: 1 for a flag on MySQL/SQLite, "1234.500000" for a MySQL decimal. Booleans become true/false, integers and numbers JSON numbers, so the wire matches $metadata whatever the driver.

Edm.Binary — base64url without padding, as the JSON format prescribes.

Int64 and Decimal under IEEE754Compatible=true — written as JSON strings so a JavaScript client keeps every digit (a decimal(19,6) exceeds what a double holds). Without the parameter they stay numbers.

Expanded navigation properties are coerced with their target type's rules, at any depth.

Methods