class DataTypeToPhpTypeConverter

Maps database column types to the PHP types PDO fetches and accepts, for each driver.

The dump, raw SQL and Blueprint paths all describe columns with schema-parser types, so one mapping serves them. Explicit casts, dates and accessors take precedence over these types.

Constants

private POSTGRES_TEXT_TYPES

PostgreSQL built-in types fetched as text, by pg_catalog name.

Methods

array
convert(string $driver, ColumnType $type, array $options, SchemaConnection $schema, array $searchPath)

Get the types a column reads and accepts, before nullability and fetch options.

Type
applyFetchOptions(Type $type, string $driver, array $fetchOptions)

Apply the connection's fetch options to a fetched type, as the union over its distinct option sets.

Details

at line 61
array convert(string $driver, ColumnType $type, array $options, SchemaConnection $schema, array $searchPath)

Get the types a column reads and accepts, before nullability and fetch options.

Parameters

string $driver
ColumnType $type
array $options

the values a CHECK constraint from Blueprint's enum() allows

SchemaConnection $schema
array $searchPath

the schemas an unqualified PostgreSQL type name resolves through

Return Value

array

at line 82
Type applyFetchOptions(Type $type, string $driver, array $fetchOptions)

Apply the connection's fetch options to a fetched type, as the union over its distinct option sets.

Parameters

Type $type
string $driver
array $fetchOptions

Return Value

Type