Doctrine


Doctrine\DBAL\Schema\Table
/Doctrine/DBAL/Schema/Table.php at line 37

Class Table

Class:Table - Superclass: AbstractAsset
AbstractAsset
⌊ Table

public class Table
extends AbstractAsset

Object Representation of a table

License:
http://www.opensource.org/licenses/lgpl-license.php LGPL
See Also:
www.doctrine-project.org
Since:
2.0
Version:
$Revision$
Author:
Benjamin Eberlei

Field Summary
final int

ID_IDENTITY

final int

$ID_NONE

final int

ID_SEQUENCE

protected array

$_columns

protected array

$_fkConstraints

protected bool

$_idGeneratorType

protected array

$_indexes

protected string

$_name

protected array

$_options

protected string

$_primaryKeyName

protected SchemaConfig

$_schemaConfig

Fields inherited from Doctrine\DBAL\Schema\AbstractAsset
_name
Constructor Summary

Table(string tableName, array columns, array options, array indexes, array fkConstraints, int idGeneratorType)

Method Summary
Column

addColumn(string columnName, mixed typeName, array options, string columnType)

Table

addForeignKeyConstraint(Table foreignTable, mixed localColumnNames, mixed foreignColumnNames, array options, array localColumns, array foreignColumns)

Add a foreign key constraintName is inferred from the local columns

Table

addIndex(array columnNames, string indexName)

Table

addNamedForeignKeyConstraint(string name, Table foreignTable, mixed localColumnNames, mixed foreignColumnNames, array options, array localColumns, array foreignColumns)

Add a foreign key constraint with a given name

Table

addOption(string name, string value)

Table

addUniqueIndex(array columnNames, string indexName)

Table

addUnnamedForeignKeyConstraint(Table foreignTable, mixed localColumnNames, mixed foreignColumnNames, array options, array localColumns, array foreignColumns)

Add a foreign key constraintName is to be generated by the database itsself.

Table

changeColumn(string columnName, array options)

Change Column Details

bool

columnsAreIndexed(array columnsNames)

Check if an index begins in the order of the given columns.

Table

dropColumn(string columnName)

Drop Column from Table

Column

getColumn(string columnName)

Get a column instance

Column[]

getColumns()

ForeignKeyConstraint

getForeignKey(string constraintName)

array

getForeignKeys()

Get Constraints

Index

getIndex(string indexName)

array

getIndexes()

void

getOption(mixed name)

void

getOptions()

Index

getPrimaryKey()

bool

hasColumn(string columnName)

Does this table have a column with the given name?

bool

hasForeignKey(string constraintName)

Does Table have a foreign key constraint with the given name?

bool

hasIndex(string indexName)

void

hasOption(mixed name)

bool

isIdGeneratorIdentity()

array

isIdGeneratorSequence()

Table

renameColumn(string oldColumnName, string newColumnName)

Rename Column

Table

setIdGeneratorType(string type)

Table

setPrimaryKey(array columns, string indexName)

Set Primary Key

void

setSchemaConfig(SchemaConfig schemaConfig)

void

visit(Visitor visitor)

Methods inherited from Doctrine\DBAL\Schema\AbstractAsset
getName

Field Detail

/Doctrine/DBAL/Schema/Table.php at line 52

ID_IDENTITY

public final int ID_IDENTITY = 2


/Doctrine/DBAL/Schema/Table.php at line 42

ID_NONE

public final int $ID_NONE


/Doctrine/DBAL/Schema/Table.php at line 47

ID_SEQUENCE

public final int ID_SEQUENCE = 1


/Doctrine/DBAL/Schema/Table.php at line 62

_columns

protected array $_columns = array()


/Doctrine/DBAL/Schema/Table.php at line 77

_fkConstraints

protected array $_fkConstraints = array()


/Doctrine/DBAL/Schema/Table.php at line 87

_idGeneratorType

protected bool $_idGeneratorType = self::ID_NONE


/Doctrine/DBAL/Schema/Table.php at line 67

_indexes

protected array $_indexes = array()


/Doctrine/DBAL/Schema/Table.php at line 57

_name

protected string $_name = null


/Doctrine/DBAL/Schema/Table.php at line 82

_options

protected array $_options = array()


/Doctrine/DBAL/Schema/Table.php at line 72

_primaryKeyName

protected string $_primaryKeyName = false


/Doctrine/DBAL/Schema/Table.php at line 92

_schemaConfig

protected SchemaConfig $_schemaConfig = null


Constructor Detail

/Doctrine/DBAL/Schema/Table.php at line 103

Table

public Table(string tableName, array columns, array options, array indexes, array fkConstraints, int idGeneratorType)


Method Detail

/Doctrine/DBAL/Schema/Table.php at line 266

addColumn

public Column addColumn(string columnName, mixed typeName, array options, string columnType)


/Doctrine/DBAL/Schema/Table.php at line 330

addForeignKeyConstraint

public Table addForeignKeyConstraint(Table foreignTable, mixed localColumnNames, mixed foreignColumnNames, array options, array localColumns, array foreignColumns)

Add a foreign key constraint

Name is inferred from the local columns


/Doctrine/DBAL/Schema/Table.php at line 181

addIndex

public Table addIndex(array columnNames, string indexName)


/Doctrine/DBAL/Schema/Table.php at line 362

addNamedForeignKeyConstraint

public Table addNamedForeignKeyConstraint(string name, Table foreignTable, mixed localColumnNames, mixed foreignColumnNames, array options, array localColumns, array foreignColumns)

Add a foreign key constraint with a given name


/Doctrine/DBAL/Schema/Table.php at line 395

addOption

public Table addOption(string name, string value)


/Doctrine/DBAL/Schema/Table.php at line 198

addUniqueIndex

public Table addUniqueIndex(array columnNames, string indexName)


/Doctrine/DBAL/Schema/Table.php at line 347

addUnnamedForeignKeyConstraint

public Table addUnnamedForeignKeyConstraint(Table foreignTable, mixed localColumnNames, mixed foreignColumnNames, array options, array localColumns, array foreignColumns)

Add a foreign key constraint

Name is to be generated by the database itsself.


/Doctrine/DBAL/Schema/Table.php at line 297

changeColumn

public Table changeColumn(string columnName, array options)

Change Column Details


/Doctrine/DBAL/Schema/Table.php at line 215

columnsAreIndexed

public bool columnsAreIndexed(array columnsNames)

Check if an index begins in the order of the given columns.


/Doctrine/DBAL/Schema/Table.php at line 310

dropColumn

public Table dropColumn(string columnName)

Drop Column from Table


/Doctrine/DBAL/Schema/Table.php at line 535

getColumn

public Column getColumn(string columnName)

Get a column instance


/Doctrine/DBAL/Schema/Table.php at line 511

getColumns

public Column[] getColumns()


/Doctrine/DBAL/Schema/Table.php at line 482

getForeignKey

public ForeignKeyConstraint getForeignKey(string constraintName)


/Doctrine/DBAL/Schema/Table.php at line 589

getForeignKeys

public array getForeignKeys()

Get Constraints


/Doctrine/DBAL/Schema/Table.php at line 567

getIndex

public Index getIndex(string indexName)


/Doctrine/DBAL/Schema/Table.php at line 579

getIndexes

public array getIndexes()


/Doctrine/DBAL/Schema/Table.php at line 599

getOption

public void getOption(mixed name)

/Doctrine/DBAL/Schema/Table.php at line 604

getOptions

public void getOptions()

/Doctrine/DBAL/Schema/Table.php at line 548

getPrimaryKey

public Index getPrimaryKey()


/Doctrine/DBAL/Schema/Table.php at line 523

hasColumn

public bool hasColumn(string columnName)

Does this table have a column with the given name?


/Doctrine/DBAL/Schema/Table.php at line 472

hasForeignKey

public bool hasForeignKey(string constraintName)

Does Table have a foreign key constraint with the given name?


/Doctrine/DBAL/Schema/Table.php at line 557

hasIndex

public bool hasIndex(string indexName)


/Doctrine/DBAL/Schema/Table.php at line 594

hasOption

public void hasOption(mixed name)

/Doctrine/DBAL/Schema/Table.php at line 495

isIdGeneratorIdentity

public bool isIdGeneratorIdentity()


/Doctrine/DBAL/Schema/Table.php at line 503

isIdGeneratorSequence

public array isIdGeneratorSequence()


/Doctrine/DBAL/Schema/Table.php at line 281

renameColumn

public Table renameColumn(string oldColumnName, string newColumnName)

Rename Column


/Doctrine/DBAL/Schema/Table.php at line 170

setIdGeneratorType

public Table setIdGeneratorType(string type)


/Doctrine/DBAL/Schema/Table.php at line 154

setPrimaryKey

public Table setPrimaryKey(array columns, string indexName)

Set Primary Key


/Doctrine/DBAL/Schema/Table.php at line 130

setSchemaConfig

public void setSchemaConfig(SchemaConfig schemaConfig)


/Doctrine/DBAL/Schema/Table.php at line 612

visit

public void visit(Visitor visitor)


Doctrine