MysqlField
final class MysqlField (View source)
Describes one MySQL result column in framework and legacy-compatible representations.
Methods
Captures MySQL field metadata as reported by the native result handle.
Returns the column name as exposed by MySQL.
Returns the normalized legacy type name or an unrecognized native type constant.
Returns the maximum observed or declared field length reported by MySQL.
Indicates whether MySQL metadata marks this field as part of the primary key.
Returns the default value reported by MySQL metadata when available.
Converts metadata to the legacy object shape expected by compatible consumers.
Converts metadata to the legacy associative array shape expected by compatible consumers.
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.
name
string
name()
Returns the column name as exposed by MySQL.
type
string|int
type()
Returns the normalized legacy type name or an unrecognized native type constant.
maxLength
int
maxLength()
Returns the maximum observed or declared field length reported by MySQL.
primaryKey
bool
primaryKey()
Indicates whether MySQL metadata marks this field as part of the primary key.
default
mixed
default()
Returns the default value reported by MySQL metadata when available.
toObject
object
toObject()
Converts metadata to the legacy object shape expected by compatible consumers.
toArray
array
toArray()
Converts metadata to the legacy associative array shape expected by compatible consumers.