Field
in package
Class Field.
Table of Contents
Properties
- $catalog : string
- The catalog name, always "def" (since PHP 5.3.6).
- $charsetnr : int
- The character set number (id) for the field.
- $db : string
- Database (since PHP 5.3.6).
- $decimals : int
- The number of decimals used (for integer fields).
- $def : string
- Reserved for default value, currently always "".
- $flags : int
- An integer representing the bit-flags for the field.
- $isAutoIncrement : bool
- Tells if field is defined as AUTO_INCREMENT.
- $isBinary : bool
- Tells if field is defined as BINARY.
- $isBlob : bool
- Tells if field is defined as BLOB.
- $isEnum : bool
- Tells if field is defined as ENUM.
- $isGroup : bool
- Tells if field is part of GROUP BY.
- $isMultipleKey : bool
- Tells if field is part of an index.
- $isNoDefaultValue : bool
- $isNotNull : bool
- Tells if field is defined as NOT NULL.
- $isNum : bool
- Tells if field is defined as NUMERIC.
- $isOnUpdateNow : bool
- $isPartKey : bool
- Tells if field is part of a multi-index.
- $isPriKey : bool
- Tells if field is part of a primary index.
- $isSet : bool
- Tells if field is defined as SET.
- $isTimestamp : bool
- Tells if field is defined as TIMESTAMP.
- $isUniqueKey : bool
- Tells if field is part of a unique index.
- $isUnsigned : bool
- Tells if field is defined as UNSIGNED.
- $isZerofill : bool
- Tells if field is defined as ZEROFILL.
- $length : int
- The width of the field, in bytes, as specified in the table definition.
- $maxLength : int
- The maximum width of the field for the result set. As of PHP 8.1, this value is always 0.
- $name : string
- The name of the column.
- $orgname : string
- Original column name if an alias was specified.
- $orgtable : string
- Original table name if an alias was specified.
- $table : string
- The name of the table this field belongs to (if not calculated).
- $type : int
- The data type used for this field.
- $typeName : string|null
- The name of the data type used for this field.
Methods
- __construct() : mixed
- setFlags() : void
- setTypeName() : void
Properties
$catalog
The catalog name, always "def" (since PHP 5.3.6).
public
string
$catalog
$charsetnr
The character set number (id) for the field.
public
int
$charsetnr
$db
Database (since PHP 5.3.6).
public
string
$db
$decimals
The number of decimals used (for integer fields).
public
int
$decimals
$def
Reserved for default value, currently always "".
public
string
$def
$flags
An integer representing the bit-flags for the field.
public
int
$flags
$isAutoIncrement
Tells if field is defined as AUTO_INCREMENT.
public
bool
$isAutoIncrement
$isBinary
Tells if field is defined as BINARY.
public
bool
$isBinary
$isBlob
Tells if field is defined as BLOB.
public
bool
$isBlob
$isEnum
Tells if field is defined as ENUM.
public
bool
$isEnum
$isGroup
Tells if field is part of GROUP BY.
public
bool
$isGroup
$isMultipleKey
Tells if field is part of an index.
public
bool
$isMultipleKey
$isNoDefaultValue
public
bool
$isNoDefaultValue
$isNotNull
Tells if field is defined as NOT NULL.
public
bool
$isNotNull
$isNum
Tells if field is defined as NUMERIC.
public
bool
$isNum
$isOnUpdateNow
public
bool
$isOnUpdateNow
$isPartKey
Tells if field is part of a multi-index.
public
bool
$isPartKey
$isPriKey
Tells if field is part of a primary index.
public
bool
$isPriKey
$isSet
Tells if field is defined as SET.
public
bool
$isSet
$isTimestamp
Tells if field is defined as TIMESTAMP.
public
bool
$isTimestamp
$isUniqueKey
Tells if field is part of a unique index.
public
bool
$isUniqueKey
$isUnsigned
Tells if field is defined as UNSIGNED.
public
bool
$isUnsigned
$isZerofill
Tells if field is defined as ZEROFILL.
public
bool
$isZerofill
$length
The width of the field, in bytes, as specified in the table definition.
public
int
$length
Note that this number (bytes) might differ from your table definition value (characters), depending on the character set you use. For example, the character set utf8 has 3 bytes per character, so varchar(10) will return a length of 30 for utf8 (103), but return 10 for latin1 (101).
$maxLength
The maximum width of the field for the result set. As of PHP 8.1, this value is always 0.
public
int
$maxLength
$name
The name of the column.
public
string
$name
$orgname
Original column name if an alias was specified.
public
string
$orgname
$orgtable
Original table name if an alias was specified.
public
string
$orgtable
$table
The name of the table this field belongs to (if not calculated).
public
string
$table
$type
The data type used for this field.
public
int
$type
$typeName
The name of the data type used for this field.
public
string|null
$typeName
Methods
__construct()
public
__construct(stdClass $field) : mixed
Parameters
- $field : stdClass
setFlags()
protected
setFlags() : void
setTypeName()
protected
setTypeName() : void