Class Xyster_Db_Gateway_TableBuilder

Description

A builder for table creation values

  • copyright: Copyright (c) 2007-2008 Irrational Logic (http://irrationallogic.net)
  • license: New BSD License

Located in /Db/Gateway/TableBuilder.php (line 36)

Xyster_Db_Gateway_Builder
   |
   --Xyster_Db_Gateway_TableBuilder
Variable Summary
Method Summary
Xyster_Db_Gateway_TableBuilder addChar (string $name, int $length)
Xyster_Db_Gateway_TableBuilder addVarchar (string $name, int $length)
void execute ()
Xyster_Db_Gateway_TableBuilder foreign (string $table, string $column, [ $onDelete = null], [ $onUpdate = null])
Xyster_Db_Gateway_TableBuilder foreignMulti ( $columns, string $table,  $foreignColumns, [ $onDelete = null], [ $onUpdate = null])
array getColumns ()
array getForeignKeys ()
array getIndexes ()
array getOptions ()
array getUniques ()
Xyster_Db_Gateway_TableBuilder index ([string $name = null], [boolean $fulltext = false])
Xyster_Db_Gateway_TableBuilder indexMulti ( $columns, [string $name = null], [boolean $fulltext = false])
Xyster_Db_Gateway_TableBuilder null ([boolean $null = true])
Xyster_Db_Gateway_TableBuilder option (string $name, mixed $value)
Variables
mixed $_columns = array() (line 44)
  • access: protected
  • access: protected
mixed $_foreign = array() (line 46)
  • access: protected
mixed $_indexes = array() (line 48)
  • access: protected
mixed $_options = array() (line 54)
  • access: protected
mixed $_primary (line 50)
  • access: protected
mixed $_uniques = array() (line 52)
  • access: protected
Methods
addBlob (line 190)

Adds a BLOB/IMAGE data type column

  • access: public
Xyster_Db_Gateway_TableBuilder addBlob (string $name)
  • string $name: The column name
addBoolean (line 204)

Adds a BOOLEAN data type column

  • access: public
Xyster_Db_Gateway_TableBuilder addBoolean (string $name)
  • string $name: The column name
addChar (line 78)

Adds a CHAR data type column

  • access: public
Xyster_Db_Gateway_TableBuilder addChar (string $name, int $length)
  • string $name: The column name
  • int $length
addClob (line 176)

Adds a CLOB/TEXT data type column

  • access: public
Xyster_Db_Gateway_TableBuilder addClob (string $name)
  • string $name: The column name
addDate (line 148)

Adds a DATE data type column

  • access: public
Xyster_Db_Gateway_TableBuilder addDate (string $name)
  • string $name: The column name
addFloat (line 120)

Adds a FLOAT data type column

  • access: public
Xyster_Db_Gateway_TableBuilder addFloat (string $name)
  • string $name: The column name
addIdentity (line 218)

Adds an IDENTITY/SERIAL data type column

  • access: public
Xyster_Db_Gateway_TableBuilder addIdentity (string $name)
  • string $name: The column name
addInteger (line 92)

Adds an INTEGER/INT data type column

  • access: public
Xyster_Db_Gateway_TableBuilder addInteger (string $name)
  • string $name: The column name
addSmallint (line 106)

Adds a SMALLINT data type column

  • access: public
Xyster_Db_Gateway_TableBuilder addSmallint (string $name)
  • string $name: The column name
addTime (line 162)

Adds a TIME data type column

  • access: public
Xyster_Db_Gateway_TableBuilder addTime (string $name)
  • string $name: The column name
addTimestamp (line 134)

Adds a TIMESTAMP data type column

  • access: public
Xyster_Db_Gateway_TableBuilder addTimestamp (string $name)
  • string $name: The column name
addVarchar (line 63)

Adds a VARCHAR data type column

  • access: public
Xyster_Db_Gateway_TableBuilder addVarchar (string $name, int $length)
  • string $name: The column name
  • int $length
defaultValue (line 232)

Sets a default value for the current column

  • access: public
Xyster_Db_Gateway_TableBuilder defaultValue (mixed $default)
  • mixed $default: The default value
execute (line 243)

Executes the create table statement

  • access: public
void execute ()

Redefinition of:
Xyster_Db_Gateway_Builder::execute()
Executes the builder
foreign (line 257)

Sets the current column as being a foreign key

  • access: public
Xyster_Db_Gateway_TableBuilder foreign (string $table, string $column, [ $onDelete = null], [ $onUpdate = null])
  • string $table: The foreign table name
  • string $column: The foreign column name
  • Xyster_Db_ReferentialAction $onDelete: optional
  • Xyster_Db_ReferentialAction $onUpdate: optional
foreignMulti (line 274)

Sets the table as having a compound foreign key

  • access: public
Xyster_Db_Gateway_TableBuilder foreignMulti ( $columns, string $table,  $foreignColumns, [ $onDelete = null], [ $onUpdate = null])
  • array $columns: The columns in the current table
  • string $table: The foreign table name
  • array $foreignColumns: The columns in the foreign table
  • Xyster_Db_ReferentialAction $onDelete: optional
  • Xyster_Db_ReferentialAction $onUpdate: optional
getColumns (line 287)

Gets the columns that have been defined in this table

array getColumns ()
getForeignKeys (line 304)

Gets the foreign keys that have been defined at the table level

Only foreign keys that have been defined using the foreignMulti method will be returned here.

array getForeignKeys ()
getIndexes (line 317)

Gets the indexes that have been defined at the table level

Only indexes that have been defined using the indexMulti method will be returned here.

array getIndexes ()
getOptions (line 327)

Gets the options set

  • access: public
array getOptions ()
getPrimaryKey (line 340)

Gets the primary keys that have been defined at the table level

Only primary keys that have been defined using the primaryMulti method will be returned here.

  • return: the composite key used
  • access: public
getUniques (line 353)

Gets the unique indexes that have been defined at the table level

Only uniques that have been defined using the uniqueMulti method will be returned here.

array getUniques ()
index (line 365)

Sets the current column as being indexed

  • access: public
Xyster_Db_Gateway_TableBuilder index ([string $name = null], [boolean $fulltext = false])
  • string $name: The name of the index
  • boolean $fulltext: If the index is fulltext
indexMulti (line 380)

Adds a compound index to the table

  • access: public
Xyster_Db_Gateway_TableBuilder indexMulti ( $columns, [string $name = null], [boolean $fulltext = false])
  • array $columns: The columns to include
  • string $name: The name of the index
  • boolean $fulltext: If the index is fulltext
null (line 393)

Sets the current column as being able to accept null or not

  • access: public
Xyster_Db_Gateway_TableBuilder null ([boolean $null = true])
  • boolean $null: True for NULL, false for NOT NULL
option (line 407)

Sets a database option

  • access: public
Xyster_Db_Gateway_TableBuilder option (string $name, mixed $value)
  • string $name
  • mixed $value
primary (line 420)

Sets the current column as being the primary key

This is unnecessary for columns of type IDENTITY

  • access: public
primaryMulti (line 433)

Sets the table as having a compound primary key

  • access: public
Xyster_Db_Gateway_TableBuilder primaryMulti ( $columns)
  • array $columns: The columns in the key
unique (line 445)

Sets the current column as being indexed uniquely

  • return: provides a fluent interface
  • access: public
uniqueMulti (line 458)

Adds a compound unique index to the table

  • return: provides a fluent interface
  • access: public
Xyster_Db_Gateway_TableBuilder uniqueMulti ( $columns)
  • array $columns: The columns to include
_checkColumnDefined (line 470)

Checks that a column has been defined

  • throws: Xyster_Db_Gateway_TableBuilder_Exception if one isn't
  • access: protected
void _checkColumnDefined ()

Inherited Methods

Inherited From Xyster_Db_Gateway_Builder

Xyster_Db_Gateway_Builder::__construct()
Xyster_Db_Gateway_Builder::execute()
Xyster_Db_Gateway_Builder::getName()
Xyster_Db_Gateway_Builder::getSchema()
Xyster_Db_Gateway_Builder::_getGateway()

Documentation generated on Mon, 19 May 2008 17:08:36 -0400 by phpDocumentor 1.4.2