PHP 클래스 Horde_Db_Adapter_Base_TableDefinition, horde

저자: Mike Naberezny ([email protected])
저자: Derek DeVries ([email protected])
저자: Chuck Hagenbuch ([email protected])
상속: implements ArrayAccess, implements IteratorAggregate
파일 보기 프로젝트 열기: horde/horde 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_base
$_columns
$_columntypes
$_name
$_options
$_primaryKey

공개 메소드들

메소드 설명
__call ( $method, $arguments ) Use __call to provide shorthand column creation ($this->integer(), etc.)
__construct ( string $name, Horde_Db_Adapter_Base_Schema $base, array $options = [] ) Constructor.
__toString ( )
belongsTo ( $columns ) Add one or several references to foreign keys
column ( $name, string $type, array $options = [] ) : Horde_Db_Adapter_Base_TableDefinition Adds a new column to the table definition.
end ( ) Wrap up table creation block & create the table
getIterator ( ) *########################################################################## # IteratorAggregate ##########################################################################
getName ( ) : string
getOptions ( ) : array
offsetExists ( integer $offset ) : boolean ArrayAccess: Check if the given offset exists
offsetGet ( integer $offset ) : object ArrayAccess: Return the value for the given offset.
offsetSet ( integer $offset, mixed $value ) ArrayAccess: Set value for given offset
offsetUnset ( integer $offset ) ArrayAccess: remove element
primaryKey ( string $name )
references ( $columns ) Alias for the belongsTo() method
timestamps ( ) Adds created_at and updated_at columns to the table.
toSql ( ) : string Returns a String whose contents are the column definitions concatenated together. This string can then be pre and appended to to generate the final SQL to create the table.

보호된 메소드들

메소드 설명
_native ( ) Get the types

메소드 상세

__call() 공개 메소드

Use __call to provide shorthand column creation ($this->integer(), etc.)
public __call ( $method, $arguments )

__construct() 공개 메소드

Constructor.
public __construct ( string $name, Horde_Db_Adapter_Base_Schema $base, array $options = [] )
$name string
$base Horde_Db_Adapter_Base_Schema
$options array

__toString() 공개 메소드

public __toString ( )

_native() 보호된 메소드

Get the types
protected _native ( )

belongsTo() 공개 메소드

This method returns self.
public belongsTo ( $columns )

column() 공개 메소드

Examples: Assuming $def is an instance of Horde_Db_Adapter_Base_TableDefinition $def->column('granted', 'boolean'); => granted BOOLEAN $def->column('picture', 'binary', 'limit' => 4096); => picture BLOB(4096) $def->column('sales_stage', 'string', array('limit' => 20, 'default' => 'new', 'null' => false)); => sales_stage VARCHAR(20) DEFAULT 'new' NOT NULL
public column ( $name, string $type, array $options = [] ) : Horde_Db_Adapter_Base_TableDefinition
$type string Column type, one of: autoincrementKey, string, text, integer, float, datetime, timestamp, time, date, binary, boolean.
$options array Column options: - autoincrement: (boolean) Whether the column is an autoincrement column. Restrictions are RDMS specific. - default: (mixed) The column's default value. You cannot explicitly set the default value to NULL. Simply leave off this option if you want a NULL default value. - limit: (integer) Maximum column length (string, text, binary or integer columns only) - null: (boolean) Whether NULL values are allowed in the column. - precision: (integer) The number precision (float columns only). - scale: (integer) The number scaling (float columns only). - unsigned: (boolean) Whether the column is an unsigned number (integer columns only).
리턴 Horde_Db_Adapter_Base_TableDefinition This object.

end() 공개 메소드

Wrap up table creation block & create the table
public end ( )

getIterator() 공개 메소드

*########################################################################## # IteratorAggregate ##########################################################################
public getIterator ( )

getName() 공개 메소드

public getName ( ) : string
리턴 string

getOptions() 공개 메소드

public getOptions ( ) : array
리턴 array

offsetExists() 공개 메소드

ArrayAccess: Check if the given offset exists
public offsetExists ( integer $offset ) : boolean
$offset integer
리턴 boolean

offsetGet() 공개 메소드

ArrayAccess: Return the value for the given offset.
public offsetGet ( integer $offset ) : object
$offset integer
리턴 object {@link {@Horde_Db_Adapter_Base_ColumnDefinition}

offsetSet() 공개 메소드

ArrayAccess: Set value for given offset
public offsetSet ( integer $offset, mixed $value )
$offset integer
$value mixed

offsetUnset() 공개 메소드

ArrayAccess: remove element
public offsetUnset ( integer $offset )
$offset integer

primaryKey() 공개 메소드

public primaryKey ( string $name )
$name string

references() 공개 메소드

This method returns self.
public references ( $columns )

timestamps() 공개 메소드

Adds created_at and updated_at columns to the table.
public timestamps ( )

toSql() 공개 메소드

Returns a String whose contents are the column definitions concatenated together. This string can then be pre and appended to to generate the final SQL to create the table.
public toSql ( ) : string
리턴 string

프로퍼티 상세

$_base 보호되어 있는 프로퍼티

protected $_base

$_columns 보호되어 있는 프로퍼티

protected $_columns

$_columntypes 보호되어 있는 프로퍼티

protected $_columntypes

$_name 보호되어 있는 프로퍼티

protected $_name

$_options 보호되어 있는 프로퍼티

protected $_options

$_primaryKey 보호되어 있는 프로퍼티

protected $_primaryKey