Method | Description | |
---|---|---|
__construct ( |
Initializes a new SchemaTool instance that uses the connection of the provided EntityManager. | |
createSchema ( array $classes ) | Creates the database schema for the given array of ClassMetadata instances. | |
dropDatabase ( ) : void | Drops all elements in the database of the current connection. | |
dropSchema ( array $classes ) : void | Drops the database schema for the given classes. | |
getCreateSchemaSql ( array $classes ) : array | Gets the list of DDL statements that are required to create the database schema for the given list of ClassMetadata instances. | |
getDropDatabaseSQL ( ) : array | Gets the SQL needed to drop the database schema for the connections database. | |
getDropSchemaSQL ( array $classes ) : array | ||
getSchemaFromMetadata ( array $classes ) : Schema | From a given set of metadata classes this method creates a Schema instance. | |
getUpdateSchemaSql ( array $classes, $saveMode = false ) : array | 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. | |
updateSchema ( array $classes, $saveMode = false ) : void | Updates the database schema of the given classes by comparing the ClassMetadata ins$tableNametances to the current database schema that is inspected. |
Method | Description | |
---|---|---|
_gatherColumn ( Doctrine\ORM\Mapping\ClassMetadata $class, array $mapping, Table $table ) : array | Creates a column definition as required by the DBAL from an ORM field mapping definition. | |
_gatherColumns ( Doctrine\ORM\Mapping\ClassMetadata $class, Table $table ) : array | Gathers the column definitions as required by the DBAL of all field mappings found in the given class. | |
_gatherRelationJoinColumns ( array $joinColumns, Doctrine\DBAL\Schema\Table $theJoinTable, Doctrine\ORM\Mapping\ClassMetadata $class, Doctrine\ORM\Mapping\AssociationMapping $mapping, array &$primaryKeyColumns, array &$uniqueConstraints ) | Gather columns and fk constraints that are required for one part of relationship. | |
_gatherRelationsSql ( Doctrine\ORM\Mapping\ClassMetadata $class, Doctrine\DBAL\Schema\Table $table, Doctrine\DBAL\Schema\Schema $schema ) : void | Gathers the SQL for properly setting up the relations of the given class. | |
_getAssociationTables ( array $classes ) | ||
_getCommitOrder ( array $classes ) | ||
_getDiscriminatorColumnDefinition ( Doctrine\ORM\Mapping\ClassMetadata $class, $table ) : array | Gets a portable column definition as required by the DBAL for the discriminator column of a class. | |
processingNotRequired ( Doctrine\ORM\Mapping\ClassMetadata $class, array $processedClasses ) : boolean | Some instances of ClassMetadata don't need to be processed in the SchemaTool context. This method detects them. |
public __construct ( |
||
$em |
public createSchema ( array $classes ) | ||
$classes | array |
public dropDatabase ( ) : void | ||
return | void |
public dropSchema ( array $classes ) : void | ||
$classes | array | |
return | void |
public getCreateSchemaSql ( array $classes ) : array | ||
$classes | array | |
return | array | $sql The SQL statements needed to create the schema for the classes. |
public getDropDatabaseSQL ( ) : array | ||
return | array |
public getDropSchemaSQL ( array $classes ) : array | ||
$classes | array | |
return | array |
public getSchemaFromMetadata ( array $classes ) : Schema | ||
$classes | array | |
return | Schema |
public getUpdateSchemaSql ( array $classes, $saveMode = false ) : array | ||
$classes | array | The classes to consider. |
return | array | The sequence of SQL statements. |
public updateSchema ( array $classes, $saveMode = false ) : void | ||
$classes | array | |
return | void |