SchemaTool
public class SchemaTool
www.doctrine-project.org
Constructor Summary | |
---|---|
SchemaTool(Doctrine\ORM\EntityManager em) Initializes a new SchemaTool instance that uses the connection of the provided EntityManager. |
Method Summary | |
---|---|
void | createSchema(array classes) Creates the database schema for the given array of ClassMetadata instances. |
void | dropSchema(array classes) Drops the database schema for the given classes. |
array | getCreateSchemaSql(array classes) Gets the list of DDL statements that are required to create the database schema for the given list of ClassMetadata instances. |
array | getDropSchemaSql(array classes) Gets the SQL needed to drop the database schema for the given classes. |
Schema | getSchemaFromMetadata(array classes) From a given set of metadata classes this method creates a Schema instance. |
array | getUpdateSchemaSql(array classes, mixed saveMode) Gets the sequence of SQL statements that need to be performed in order to bring the given class mappings in-synch with the relational schema. |
void | updateSchema(array classes, mixed saveMode) Updates the database schema of the given classes by comparing the ClassMetadata instances to the current database schema that is inspected. |
public SchemaTool(Doctrine\ORM\EntityManager em)
Initializes a new SchemaTool instance that uses the connection of the provided EntityManager.
public void createSchema(array classes)
Creates the database schema for the given array of ClassMetadata instances.
public void dropSchema(array classes)
Drops the database schema for the given classes.
In any way when an exception is thrown it is supressed since drop was issued for all classes of the schema and some probably just don't exist.
public array getCreateSchemaSql(array classes)
Gets the list of DDL statements that are required to create the database schema for the given list of ClassMetadata instances.
public array getDropSchemaSql(array classes)
Gets the SQL needed to drop the database schema for the given classes.
public Schema getSchemaFromMetadata(array classes)
From a given set of metadata classes this method creates a Schema instance.
public array getUpdateSchemaSql(array classes, mixed saveMode)
Gets the sequence of SQL statements that need to be performed in order to bring the given class mappings in-synch with the relational schema.
public void updateSchema(array classes, mixed saveMode)
Updates the database schema of the given classes by comparing the ClassMetadata instances to the current database schema that is inspected.
The SchemaTool is a tool to create/drop/update database schemas based on ClassMetadata class descriptors.