Doctrine\DBAL\Schema\Table
Object Representation of a table
- Author: Benjamin Eberlei <kontakt@beberlei.de>
Synopsis
class Table
extends AbstractAsset
{
- // members
- protected string $_name;
- protected array $_columns;
- protected array $_indexes;
- protected string $_primaryKeyName;
- protected array $_fkConstraints;
- protected array $_options;
- protected SchemaConfig $_schemaConfig;
- // Inherited members from AbstractAsset
- protected string $_name;
- protected string $_namespace;
- protected bool $_quoted;
- // methods
- public void __construct()
- public void setSchemaConfig()
- protected int _getMaxIdentifierLength()
- public Table setPrimaryKey()
- public Table addIndex()
- public void dropPrimaryKey()
- public void dropIndex()
- public Table addUniqueIndex()
- public bool columnsAreIndexed()
- private Table _createIndex()
- public Column addColumn()
- public Table renameColumn()
- public Table changeColumn()
- public Table dropColumn()
- public Table addForeignKeyConstraint()
- public Table addUnnamedForeignKeyConstraint()
- public Table addNamedForeignKeyConstraint()
- public Table addOption()
- protected void _addColumn()
- protected Table _addIndex()
- protected void _addForeignKeyConstraint()
- public bool hasForeignKey()
- public ForeignKeyConstraint getForeignKey()
- public void removeForeignKey()
- public array getColumns()
- public bool hasColumn()
- public Column getColumn()
- public Index|null getPrimaryKey()
- public void getPrimaryKeyColumns()
- public bool hasPrimaryKey()
- public bool hasIndex()
- public Index getIndex()
- public array getIndexes()
- public array getForeignKeys()
- public void hasOption()
- public void getOption()
- public void getOptions()
- public void visit()
- public void __clone()
- // Inherited methods from AbstractAsset
- protected void _setName()
- public bool isInDefaultNamespace()
- public string getNamespaceName()
- public string getShortestName()
- public string getFullQualifiedName()
- public bool isQuoted()
- protected bool isIdentifierQuoted()
- protected string trimQuotes()
- public string getName()
- public string getQuotedName()
- protected string _generateIdentifierName()
Hierarchy
Members
protected
- $_columns — array
- $_fkConstraints — array
- $_indexes — array
- $_name — string
- $_name — string
- $_namespace
—
string
Namespace of the asset. If none isset the default namespace is assumed. - $_options — array
- $_primaryKeyName — string
- $_quoted — Doctrine\DBAL\Schema\bool
- $_schemaConfig — Doctrine\DBAL\Schema\SchemaConfig
Methods
private
protected
- _addColumn()
- _addForeignKeyConstraint()
- _addIndex() — Add index to table
- _getMaxIdentifierLength()
public
- __construct()
- __clone() — Clone of a Table triggers a deep clone of all affected assets
- addColumn()
- addForeignKeyConstraint() — Add a foreign key constraint
- addIndex()
- addNamedForeignKeyConstraint() — Add a foreign key constraint with a given name
- addOption()
- addUniqueIndex()
- addUnnamedForeignKeyConstraint() — Add a foreign key constraint
- changeColumn() — Change Column Details
- columnsAreIndexed() — Check if an index begins in the order of the given columns.
- dropColumn() — Drop Column from Table
- dropIndex() — Drop an index from this table.
- dropPrimaryKey() — Drop an index from this table.
- getColumn() — Get a column instance
- getColumns()
- getForeignKey()
- getForeignKeys() — Get Constraints
- getIndex()
- getIndexes()
- getOption()
- getOptions()
- getPrimaryKey()
- getPrimaryKeyColumns()
- hasColumn() — Does this table have a column with the given name?
- hasForeignKey() — Does Table have a foreign key constraint with the given name?
- hasIndex()
- hasOption()
- hasPrimaryKey() — Check if this table has a primary key.
- removeForeignKey()
- renameColumn() — Rename Column
- setPrimaryKey() — Set Primary Key
- setSchemaConfig()
- visit()
Inherited from Doctrine\DBAL\Schema\AbstractAsset
protected
- _generateIdentifierName() — Generate an identifier from a list of column names obeying a certain string length.
- _setName() — Set name of this asset
- isIdentifierQuoted() — Check if this identifier is quoted.
- trimQuotes() — Trim quotes from the identifier.
public
- getFullQualifiedName() — The normalized name is full-qualified and lowerspaced. Lowerspacing is actually wrong, but we have to do it to keep our sanity. If you are using database objects that only differentiate in the casing (FOO vs Foo) then you will NOT be able to use Doctrine Schema abstraction.
- getName() — Return name of this schema asset.
- getNamespaceName() — Get namespace name of this asset.
- getQuotedName() — Get the quoted representation of this asset but only if it was defined with one. Otherwise return the plain unquoted value as inserted.
- getShortestName() — The shortest name is stripped of the default namespace. All other namespaced elements are returned as full-qualified names.
- isInDefaultNamespace() — Is this asset in the default namespace?
- isQuoted() — Check if this asset's name is quoted