final class MysqlField (View source)

Describes one MySQL result column in framework and legacy-compatible representations.

Methods

__construct(string $name, string|int $type, int $maxLength, bool $primaryKey, mixed $default)

Captures MySQL field metadata as reported by the native result handle.

string
name()

Returns the column name as exposed by MySQL.

string
string|int
type()

Returns the normalized legacy type name or an unrecognized native type constant.

string|int
int

Returns the maximum observed or declared field length reported by MySQL.

int
bool

Indicates whether MySQL metadata marks this field as part of the primary key.

bool
mixed

Returns the default value reported by MySQL metadata when available.

mixed
object

Converts metadata to the legacy object shape expected by compatible consumers.

object
array

Converts metadata to the legacy associative array shape expected by compatible consumers.

array

Details

__construct

__construct(string $name, string|int $type, int $maxLength, bool $primaryKey, mixed $default)

Captures MySQL field metadata as reported by the native result handle.

Parameters

string $name
string|int $type
int $maxLength
bool $primaryKey
mixed $default

name

string name()

Returns the column name as exposed by MySQL.

Return Value

string

type

string|int type()

Returns the normalized legacy type name or an unrecognized native type constant.

Return Value

string|int

maxLength

int maxLength()

Returns the maximum observed or declared field length reported by MySQL.

Return Value

int

primaryKey

bool primaryKey()

Indicates whether MySQL metadata marks this field as part of the primary key.

Return Value

bool

default

mixed default()

Returns the default value reported by MySQL metadata when available.

Return Value

mixed

toObject

object toObject()

Converts metadata to the legacy object shape expected by compatible consumers.

Return Value

object

toArray

array toArray()

Converts metadata to the legacy associative array shape expected by compatible consumers.

Return Value

array