프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$_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 |
public __call ( $method, $arguments ) |
public __construct ( string $name, Horde_Db_Adapter_Base_Schema $base, array $options = [] ) | ||
$name | string | |
$base | Horde_Db_Adapter_Base_Schema | |
$options | array |
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. |
public getIterator ( ) |
public offsetExists ( integer $offset ) : boolean | ||
$offset | integer | |
리턴 | boolean |
public offsetUnset ( integer $offset ) | ||
$offset | integer |