Abstract class defining database / table creation methods

package Query
subpackage Table_Builder

 Methods

Constructor

__construct(\Query\Table\[string] $name = '', \Query\Table\[array] $options = array(), \Query\Table\[Driver_Interface] $driver = NULL) : \Query\Table\Table_Builder

Alias to constructor

__invoke(\Query\Table\[string] $name = '', \Query\Table\[array] $options = array(), \Query\Table\[\Query\Driver\Driver_Interface] $driver = NULL) : \Query\Table\Table_Builder

Add a column to the current table

add_column(string $column_name, string $type = NULL, array $options = array()) : \Query\Table\Table_Builder

Parameters

$column_name

string

$type

string

$options

array

Returns

add_foreign_key()

add_foreign_key($columns, $referenced_table, $referenced_columns = array('id'), $options = array()

Parameters

$columns

$referenced_table

$referenced_columns

$options

add_index()

add_index($columns, $options = array()

Parameters

$columns

$options

change_column()

change_column($column_name, $new_column_type, $options = array()

Parameters

$column_name

$new_column_type

$options

create()

create() 

drop()

drop() 

drop_foreign_key()

drop_foreign_key($columns, $constraint = NULL

Parameters

$columns

$constraint

exists()

exists() 

get_columns()

get_columns() 

Get the current DB Driver

get_driver() : \Query\Driver_Interface

has_column()

has_column($column_name, $options = array()

Parameters

$column_name

$options

has_foreign_key()

has_foreign_key($columns, $constraint = NULL

Parameters

$columns

$constraint

has_index()

has_index($columns, $options = array()

Parameters

$columns

$options

remove_column()

remove_column($column_name) 

Parameters

$column_name

remove_index()

remove_index($columns, $options = array()

Parameters

$columns

$options

remove_index_by_name()

remove_index_by_name($name) 

Parameters

$name

rename()

rename($new_table_name) 

Parameters

$new_table_name

rename_column()

rename_column($old_name, $new_name) 

Parameters

$old_name

$new_name

reset()

reset() 

save()

save() 

Set the reference to the current database driver

set_driver(\Query\Driver\Driver_Interface $driver = NULL) : \Query\Table\Table_Builder

update()

update() 

 Properties

 

The name of the current table

$name : string

Default

''
 

Columns to be added/updated for the current table

$columns : array

Default

array()
 

Driver for the current db

$driver : \Query\Driver\Driver_Interface

Default

NULL
 

Foreign keys to be added/updated for the current table

$foreign_keys : array

Default

array()
 

Indexes to be added/updated for the current table

$indexes : array

Default

array()
 

Options for the current table

$table_options : array

Default

array()