PHP Класс Horde_Db_Adapter_Base_TableDefinition, horde

Автор: Mike Naberezny ([email protected])
Автор: Derek DeVries ([email protected])
Автор: Chuck Hagenbuch ([email protected])
Наследование: implements ArrayAccess, implements IteratorAggregate
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_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

Описание методов

__call() публичный Метод

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

__construct() публичный Метод

Constructor.
public __construct ( string $name, Horde_Db_Adapter_Base_Schema $base, array $options = [] )
$name string
$base Horde_Db_Adapter_Base_Schema
$options array

__toString() публичный Метод

public __toString ( )

_native() защищенный Метод

Get the types
protected _native ( )

belongsTo() публичный Метод

This method returns self.
public belongsTo ( $columns )

column() публичный Метод

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
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.

end() публичный Метод

Wrap up table creation block & create the table
public end ( )

getIterator() публичный Метод

*########################################################################## # IteratorAggregate ##########################################################################
public getIterator ( )

getName() публичный Метод

public getName ( ) : string
Результат string

getOptions() публичный Метод

public getOptions ( ) : array
Результат array

offsetExists() публичный Метод

ArrayAccess: Check if the given offset exists
public offsetExists ( integer $offset ) : boolean
$offset integer
Результат boolean

offsetGet() публичный Метод

ArrayAccess: Return the value for the given offset.
public offsetGet ( integer $offset ) : object
$offset integer
Результат object {@link {@Horde_Db_Adapter_Base_ColumnDefinition}

offsetSet() публичный Метод

ArrayAccess: Set value for given offset
public offsetSet ( integer $offset, mixed $value )
$offset integer
$value mixed

offsetUnset() публичный Метод

ArrayAccess: remove element
public offsetUnset ( integer $offset )
$offset integer

primaryKey() публичный Метод

public primaryKey ( string $name )
$name string

references() публичный Метод

This method returns self.
public references ( $columns )

timestamps() публичный Метод

Adds created_at and updated_at columns to the table.
public timestamps ( )

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.
public toSql ( ) : string
Результат string

Описание свойств

$_base защищенное свойство

protected $_base

$_columns защищенное свойство

protected $_columns

$_columntypes защищенное свойство

protected $_columntypes

$_name защищенное свойство

protected $_name

$_options защищенное свойство

protected $_options

$_primaryKey защищенное свойство

protected $_primaryKey