Overview

Packages

  • Db
    • Adapter
    • Migration

Classes

  • Horde_Db_Adapter_Base
  • Horde_Db_Adapter_Base_Column
  • Horde_Db_Adapter_Base_ColumnDefinition
  • Horde_Db_Adapter_Base_Index
  • Horde_Db_Adapter_Base_Schema
  • Horde_Db_Adapter_Base_Table
  • Horde_Db_Adapter_Base_TableDefinition
  • Horde_Db_Adapter_Mysql
  • Horde_Db_Adapter_Mysql_Column
  • Horde_Db_Adapter_Mysql_Result
  • Horde_Db_Adapter_Mysql_Schema
  • Horde_Db_Adapter_Mysqli
  • Horde_Db_Adapter_Mysqli_Result
  • Horde_Db_Adapter_Pdo_Base
  • Horde_Db_Adapter_Pdo_Mysql
  • Horde_Db_Adapter_Pdo_Pgsql
  • Horde_Db_Adapter_Pdo_Sqlite
  • Horde_Db_Adapter_Postgresql_Column
  • Horde_Db_Adapter_Postgresql_Schema
  • Horde_Db_Adapter_SplitRead
  • Horde_Db_Adapter_Sqlite_Column
  • Horde_Db_Adapter_Sqlite_Schema

Interfaces

  • Horde_Db_Adapter
  • Overview
  • Package
  • Class
  • Tree

Class Horde_Db_Adapter_Base_TableDefinition

Horde_Db_Adapter_Base_TableDefinition implements ArrayAccess, IteratorAggregate
Package: Db\Adapter
Category: Horde
License: http://www.horde.org/licenses/bsd
Author: Mike Naberezny mike@maintainable.com
Author: Derek DeVries derek@maintainable.com
Author: Chuck Hagenbuch chuck@horde.org
Located at Horde/Db/Adapter/Base/TableDefinition.php
Methods summary
public
# __construct( string $name, Horde_Db_Adapter_Base_Schema $base, array $options = array() )

Constructor.

Constructor.

Parameters

$name
$base
$options
public string
# getName( )

Returns

string
public array
# getOptions( )

Returns

array
public
# primaryKey( string $name )

Parameters

$name
public Horde_Db_Adapter_Base_TableDefinition
# column( string $name, array $type, mixed $options = array() )

Adds a new column to the table definition.

Adds a new column to the table definition.

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

Parameters

$name
<p>$type Column type, one of: autoincrementKey, string, text, integer, float, datetime, timestamp, time, date, binary, boolean.</p>
$type
<p>$options Column options: - limit: (integer) Maximum column length (string, text, binary or integer columns only) - 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. - 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). - autoincrement: (boolean) Whether the column is an autoincrement column. Restrictions are RDMS specific.</p>
$options

Returns

Horde_Db_Adapter_Base_TableDefinition
This object.
public
# timestamps( )

Adds created_at and updated_at columns to the table.

Adds created_at and updated_at columns to the table.

public
# belongsTo( mixed $columns )

Add one or several references to foreign keys

Add one or several references to foreign keys

This method returns self.

public
# references( mixed $columns )

Alias for the belongsTo() method

Alias for the belongsTo() method

This method returns self.

public
# __call( mixed $method, mixed $arguments )

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

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

public
# end( )

Wrap up table creation block & create the table

Wrap up table creation block & create the table

public string
# 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.

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.

Returns

string
public
# __toString( )
public boolean
# offsetExists( integer $offset )

ArrayAccess: Check if the given offset exists

ArrayAccess: Check if the given offset exists

Parameters

$offset

Returns

boolean

Implementation of

ArrayAccess::offsetExists()
public object
# offsetGet( integer $offset )

ArrayAccess: Return the value for the given offset.

ArrayAccess: Return the value for the given offset.

Parameters

$offset

Returns

object
{@Horde_Db_Adapter_Base_ColumnDefinition

Implementation of

ArrayAccess::offsetGet()
public
# offsetSet( integer $offset, mixed $value )

ArrayAccess: Set value for given offset

ArrayAccess: Set value for given offset

Parameters

$offset
$value

Implementation of

ArrayAccess::offsetSet()
public
# offsetUnset( integer $offset )

ArrayAccess: remove element

ArrayAccess: remove element

Parameters

$offset

Implementation of

ArrayAccess::offsetUnset()
public
# getIterator( )

Implementation of

IteratorAggregate::getIterator()
API documentation generated by ApiGen