interface Converter (View source)

Interface for type conversions.

Methods

mixed
convertFromString(string $data, int $type)

Convert a string received from the PostgreSQL server back to a PHP type.

string
convertToString(mixed $value, int $type)

Convert a value to a string for use in a query.

array
convertTypes()

Announce which types the implementing converter can handle.

Details

mixed convertFromString(string $data, int $type)

Convert a string received from the PostgreSQL server back to a PHP type.

Parameters

string $data

String data received from the server.

int $type

The type OID of the data. Irrelevant for single-type converters.

Return Value

mixed

the value converted to a PHP type.

string convertToString(mixed $value, int $type)

Convert a value to a string for use in a query.

Parameters

mixed $value

The PHP value which should be converted to a string.

int $type

The type OID the converter should handle. Irrelevant for singly-type converters.

Return Value

string

a textual representation of the value accepted by the PostgreSQL server.

array convertTypes()

Announce which types the implementing converter can handle.

Return Value

array

OIDs of handled types.