Doctrine


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

Class Schema

Class:Schema - Superclass: AbstractAsset
AbstractAsset
⌊ Schema

public class Schema
extends AbstractAsset

Object representation of a database schema

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
protected SchemaConfig

$_schemaConfig

protected array

$_sequences

protected array

$_tables

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

Schema(array tables, SchemaConfig schemaConfig, array sequences, array views, array triggers)

Method Summary
Sequence

createSequence(string sequenceName, int allocationSize, int initialValue)

Create a new sequence

Table

createTable(string tableName)

Create a new table

Schema

dropSequence(string sequenceName)

Schema

dropTable(string tableName)

Drop a table from the schema.

void

getMigrateFromSql(Schema fromSchema, AbstractPlatform platform)

void

getMigrateToSql(Schema toSchema, AbstractPlatform platform)

Doctrine\DBAL\Schema\Sequence

getSequence(string sequenceName)

Doctrine\DBAL\Schema\Sequence[]

getSequences()

Table

getTable(string tableName)

array

getTables()

Get all tables of this schema.

bool

hasExplicitForeignKeyIndexes()

bool

hasSequence(string sequenceName)

Schema

hasTable(string tableName)

Does this schema have a table with the given name?

Schema

renameTable(string oldTableName, string newTableName)

Rename a table

array

toDropSql(AbstractPlatform platform)

Return an array of necessary sql queries to drop the schema on the given platform.

array

toSql(AbstractPlatform platform)

Return an array of necessary sql queries to create the schema on the given platform.

void

visit(Visitor visitor)

Methods inherited from Doctrine\DBAL\Schema\AbstractAsset
getName

Field Detail

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

_schemaConfig

protected SchemaConfig $_schemaConfig = false


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

_sequences

protected array $_sequences = array()


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

_tables

protected array $_tables = array()


Constructor Detail

/Doctrine/DBAL/Schema/Schema.php at line 61

Schema

public Schema(array tables, SchemaConfig schemaConfig, array sequences, array views, array triggers)


Method Detail

/Doctrine/DBAL/Schema/Schema.php at line 230

createSequence

public Sequence createSequence(string sequenceName, int allocationSize, int initialValue)

Create a new sequence


/Doctrine/DBAL/Schema/Schema.php at line 184

createTable

public Table createTable(string tableName)

Create a new table


/Doctrine/DBAL/Schema/Schema.php at line 241

dropSequence

public Schema dropSequence(string sequenceName)


/Doctrine/DBAL/Schema/Schema.php at line 214

dropTable

public Schema dropTable(string tableName)

Drop a table from the schema.


/Doctrine/DBAL/Schema/Schema.php at line 291

getMigrateFromSql

public void getMigrateFromSql(Schema fromSchema, AbstractPlatform platform)


/Doctrine/DBAL/Schema/Schema.php at line 280

getMigrateToSql

public void getMigrateToSql(Schema toSchema, AbstractPlatform platform)


/Doctrine/DBAL/Schema/Schema.php at line 161

getSequence

public Doctrine\DBAL\Schema\Sequence getSequence(string sequenceName)

Throws:
SchemaException

/Doctrine/DBAL/Schema/Schema.php at line 173

getSequences

public Doctrine\DBAL\Schema\Sequence[] getSequences()


/Doctrine/DBAL/Schema/Schema.php at line 124

getTable

public Table getTable(string tableName)


/Doctrine/DBAL/Schema/Schema.php at line 115

getTables

public array getTables()

Get all tables of this schema.


/Doctrine/DBAL/Schema/Schema.php at line 79

hasExplicitForeignKeyIndexes

public bool hasExplicitForeignKeyIndexes()


/Doctrine/DBAL/Schema/Schema.php at line 150

hasSequence

public bool hasSequence(string sequenceName)


/Doctrine/DBAL/Schema/Schema.php at line 140

hasTable

public Schema hasTable(string tableName)

Does this schema have a table with the given name?


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

renameTable

public Schema renameTable(string oldTableName, string newTableName)

Rename a table


/Doctrine/DBAL/Schema/Schema.php at line 268

toDropSql

public array toDropSql(AbstractPlatform platform)

Return an array of necessary sql queries to drop the schema on the given platform.


/Doctrine/DBAL/Schema/Schema.php at line 254

toSql

public array toSql(AbstractPlatform platform)

Return an array of necessary sql queries to create the schema on the given platform.


/Doctrine/DBAL/Schema/Schema.php at line 301

visit

public void visit(Visitor visitor)


Doctrine