Class Xyster_Db_Gateway_IndexBuilder

Description

A builder for indexes

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

Located in /Db/Gateway/IndexBuilder.php (line 32)

Xyster_Db_Gateway_Builder
   |
   --Xyster_Db_Gateway_IndexBuilder
Variable Summary
mixed $_columns
mixed $_fulltext
mixed $_table
mixed $_unique
Method Summary
void execute ()
Xyster_Db_Gateway_IndexBuilder fulltext ([boolean $fulltext = true])
array getColumns ()
string getTable ()
boolean isFulltext ()
boolean isUnique ()
Xyster_Db_Gateway_IndexBuilder on (string $table,  $columns)
Xyster_Db_Gateway_IndexBuilder unique ([boolean $unique = true])
Variables
mixed $_columns = array() (line 34)
  • access: protected
mixed $_fulltext = false (line 36)
  • access: protected
mixed $_table (line 38)
  • access: protected
mixed $_unique = false (line 40)
  • access: protected
Methods
execute (line 46)

Executes the create table statement

  • access: public
void execute ()

Redefinition of:
Xyster_Db_Gateway_Builder::execute()
Executes the builder
fulltext (line 63)

Sets the index to be full text

An index cannot be both full text and unique

  • return: provides a fluent interface
  • access: public
Xyster_Db_Gateway_IndexBuilder fulltext ([boolean $fulltext = true])
  • boolean $fulltext
getColumns (line 75)

Gets the columns in the index

  • return: an array with Xyster_Data_Sort objects
  • access: public
array getColumns ()
getTable (line 85)

Gets the table name

  • access: public
string getTable ()
isFulltext (line 95)

Whether the index is full text

  • access: public
boolean isFulltext ()
isUnique (line 105)

Whether the index is UNIQUE

  • access: public
boolean isUnique ()
on (line 132)

Assigns the index to reference a table and columns

The schema name should be specified in the IndexBuilder constructor.

The columns array should either be an array with column names as values or an array with column names as keys and either "ASC" or "DESC" for each value (indicating the sort order of the index). You can actually mix and match:

array(
     'my_column',
     'another_column' => 'DESC',
     'foobar_column',
     'final_column' => 'ASC',
 );

  • return: provides a fluent interface
  • access: public
Xyster_Db_Gateway_IndexBuilder on (string $table,  $columns)
  • string $table
  • array $columns
unique (line 152)

Sets the index to be UNIQUE

An index cannot be both full text and unique

  • return: provides a fluent interface
  • access: public
Xyster_Db_Gateway_IndexBuilder unique ([boolean $unique = true])
  • boolean $unique

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:22 -0400 by phpDocumentor 1.4.2