Properties

$_name

$_name : 

Type

$_type

$_type : 

Type

$_null

$_null : 

Type

$_limit

$_limit : 

Type

$_precision

$_precision : 

Type

$_scale

$_scale : 

Type

$_unsigned

$_unsigned : 

Type

$_default

$_default : 

Type

$_sqlType

$_sqlType : 

Type

$_isText

$_isText : 

Type

$_isNumber

$_isNumber : 

Type

$_hasEmptyStringDefault

$_hasEmptyStringDefault : array

Type

array

$_originalDefault

$_originalDefault : string

Type

string

Methods

__construct()

__construct(string  $name, string  $default, string  $sqlType = null, boolean  $null = true) 

Construct

Parameters

string $name

The column's name, such as "supplier_id" in "supplier_id int(11)".

string $default

The type-casted default value, such as "new" in "sales_stage varchar(20) default 'new'".

string $sqlType

Used to extract the column's type, length and signed status, if necessary. For example "varchar" and "60" in "company_name varchar(60)" or "unsigned => true" in "int(10) UNSIGNED".

boolean $null

Whether this column allows NULL values.

isText()

isText() : boolean

Returns

boolean

isNumber()

isNumber() : boolean

Returns

boolean

typeCast()

typeCast(  $value) 

Casts value (which is a String) to an appropriate instance.

Parameters

$value

extractDefault()

extractDefault(  $default) 

Parameters

$default

getName()

getName() : string

Returns

string

getDefault()

getDefault() : string

Returns

string

getType()

getType() : string

Returns

string

getLimit()

getLimit() : integer

Returns

integer

precision()

precision() : integer

Returns

integer

scale()

scale() : integer

Returns

integer

isUnsigned()

isUnsigned() : boolean

Returns

boolean

isNull()

isNull() : boolean

Returns

boolean

getSqlType()

getSqlType() : string

Returns

string

binaryToString()

binaryToString(  $value) : string

Used to convert from BLOBs to Strings

Parameters

$value

Returns

string

stringToDate()

stringToDate(string  $string) : \Horde_Date

Parameters

string $string

Returns

\Horde_Date

stringToTime()

stringToTime(string  $string) : \Horde_Date

Parameters

string $string

Returns

\Horde_Date

stringToDummyTime()

stringToDummyTime(  $value) : \Horde_Date

Parameters

$value

Returns

\Horde_Date

valueToBoolean()

valueToBoolean(mixed  $value) : boolean

Parameters

mixed $value

Returns

boolean

valueToDecimal()

valueToDecimal(mixed  $value) : \decimal

Parameters

mixed $value

Returns

\decimal

_extractLimit()

_extractLimit(string  $sqlType) : integer

Parameters

string $sqlType

Returns

integer

_extractPrecision()

_extractPrecision(string  $sqlType) : integer

Parameters

string $sqlType

Returns

integer

_extractScale()

_extractScale(string  $sqlType) : integer

Parameters

string $sqlType

Returns

integer

_extractUnsigned()

_extractUnsigned(string  $sqlType) : integer

Parameters

string $sqlType

Returns

integer

_setSimplifiedType()

_setSimplifiedType() 

_isMissingDefaultForgedAsEmptyString()

_isMissingDefaultForgedAsEmptyString() : boolean

MySQL misreports NOT NULL column default when none is given.

We can't detect this for columns which may have a legitimate '' default (string, text, binary) but we can for others (integer, datetime, boolean, and the rest).

Test whether the column has default '', is not null, and is not a type allowing default ''.

Returns

boolean