Flow PHP

EntryTypeResolver

Read onlyYes
FinalYes

Resolves the concrete member Type of a union column for a given value.

Methods

fromUnion()  : Type<string|int, mixed>
A union is resolved to the first member accepting the value, falling back to the first member the value can be cast to, mirroring UnionType::cast().

Methods

fromUnion()

A union is resolved to the first member accepting the value, falling back to the first member the value can be cast to, mirroring UnionType::cast().

public fromUnion(Type<string|int, mixed>|UnionType<mixed, mixed> $type, mixed $value, string $entryName) : Type<string|int, mixed>
Parameters
$type : Type<string|int, mixed>|UnionType<mixed, mixed>
$value : mixed
$entryName : string
Tags
throws
InvalidArgumentException

when the value matches no union member

Return values
Type<string|int, mixed>
On this page

Search results