PHP Class Horde_Db_Adapter_Base_Column, horde

Author: Mike Naberezny ([email protected])
Author: Derek DeVries ([email protected])
Author: Chuck Hagenbuch ([email protected])
Show file Open project: horde/horde Class Usage Examples

Protected Properties

Property Type Description
$_default
$_isNumber
$_isText
$_limit
$_name
$_null
$_precision
$_scale
$_sqlType
$_type
$_unsigned

Public Methods

Method Description
__construct ( string $name, string $default, string $sqlType = null, boolean $null = true ) Constructor.
binaryToString ( $value ) : string Used to convert from BLOBs to Strings
extractDefault ( $default )
getDefault ( ) : string
getLimit ( ) : integer
getName ( ) : string
getSqlType ( ) : string
getType ( ) : string
isNull ( ) : boolean
isNumber ( ) : boolean
isText ( ) : boolean
isUnsigned ( ) : boolean
precision ( ) : integer
scale ( ) : integer
stringToDate ( string $string ) : Horde_Date
stringToDummyTime ( $value ) : Horde_Date
stringToTime ( string $string ) : Horde_Date
typeCast ( $value ) Casts value (which is a String) to an appropriate instance.
valueToBoolean ( mixed $value ) : boolean
valueToDecimal ( mixed $value ) : decimal

Protected Methods

Method Description
_extractLimit ( string $sqlType ) : integer
_extractPrecision ( string $sqlType ) : integer
_extractScale ( string $sqlType ) : integer
_extractUnsigned ( string $sqlType ) : integer
_setSimplifiedType ( )

Method Details

__construct() public method

Constructor.
public __construct ( string $name, string $default, string $sqlType = null, boolean $null = true )
$name string The column's name, such as "supplier_id" in "supplier_id int(11)".
$default string The type-casted default value, such as "new" in "sales_stage varchar(20) default 'new'".
$sqlType string 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".
$null boolean Whether this column allows NULL values.

_extractLimit() protected method

protected _extractLimit ( string $sqlType ) : integer
$sqlType string
return integer

_extractPrecision() protected method

protected _extractPrecision ( string $sqlType ) : integer
$sqlType string
return integer

_extractScale() protected method

protected _extractScale ( string $sqlType ) : integer
$sqlType string
return integer

_extractUnsigned() protected method

protected _extractUnsigned ( string $sqlType ) : integer
$sqlType string
return integer

_setSimplifiedType() protected method

protected _setSimplifiedType ( )

binaryToString() public method

Used to convert from BLOBs to Strings
public binaryToString ( $value ) : string
return string

extractDefault() public method

public extractDefault ( $default )

getDefault() public method

public getDefault ( ) : string
return string

getLimit() public method

public getLimit ( ) : integer
return integer

getName() public method

public getName ( ) : string
return string

getSqlType() public method

public getSqlType ( ) : string
return string

getType() public method

public getType ( ) : string
return string

isNull() public method

public isNull ( ) : boolean
return boolean

isNumber() public method

public isNumber ( ) : boolean
return boolean

isText() public method

public isText ( ) : boolean
return boolean

isUnsigned() public method

public isUnsigned ( ) : boolean
return boolean

precision() public method

public precision ( ) : integer
return integer

scale() public method

public scale ( ) : integer
return integer

stringToDate() public method

public stringToDate ( string $string ) : Horde_Date
$string string
return Horde_Date

stringToDummyTime() public method

public stringToDummyTime ( $value ) : Horde_Date
return Horde_Date

stringToTime() public method

public stringToTime ( string $string ) : Horde_Date
$string string
return Horde_Date

typeCast() public method

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

valueToBoolean() public method

public valueToBoolean ( mixed $value ) : boolean
$value mixed
return boolean

valueToDecimal() public method

public valueToDecimal ( mixed $value ) : decimal
$value mixed
return decimal

Property Details

$_default protected property

protected $_default

$_isNumber protected property

protected $_isNumber

$_isText protected property

protected $_isText

$_limit protected property

protected $_limit

$_name protected property

protected $_name

$_null protected property

protected $_null

$_precision protected property

protected $_precision

$_scale protected property

protected $_scale

$_sqlType protected property

protected $_sqlType

$_type protected property

protected $_type

$_unsigned protected property

protected $_unsigned