PHP 클래스 Doctrine\ORM\Tools\SchemaTool

부터: 2.0
저자: Guilherme Blanco ([email protected])
저자: Jonathan Wage ([email protected])
저자: Roman Borschel ([email protected])
저자: Benjamin Eberlei ([email protected])
저자: Stefano Rodriguez ([email protected])
파일 보기 프로젝트 열기: pmjones/php-framework-benchmarks 1 사용 예제들

공개 메소드들

메소드 설명
__construct ( EntityManager $em ) 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.

비공개 메소드들

메소드 설명
_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.

메소드 상세

__construct() 공개 메소드

Initializes a new SchemaTool instance that uses the connection of the provided EntityManager.
public __construct ( EntityManager $em )
$em Doctrine\ORM\EntityManager

createSchema() 공개 메소드

Creates the database schema for the given array of ClassMetadata instances.
public createSchema ( array $classes )
$classes array

dropDatabase() 공개 메소드

Drops all elements in the database of the current connection.
public dropDatabase ( ) : void
리턴 void

dropSchema() 공개 메소드

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 dropSchema ( array $classes ) : void
$classes array
리턴 void

getCreateSchemaSql() 공개 메소드

Gets the list of DDL statements that are required to create the database schema for the given list of ClassMetadata instances.
public getCreateSchemaSql ( array $classes ) : array
$classes array
리턴 array $sql The SQL statements needed to create the schema for the classes.

getDropDatabaseSQL() 공개 메소드

Gets the SQL needed to drop the database schema for the connections database.
public getDropDatabaseSQL ( ) : array
리턴 array

getDropSchemaSQL() 공개 메소드

public getDropSchemaSQL ( array $classes ) : array
$classes array
리턴 array

getSchemaFromMetadata() 공개 메소드

From a given set of metadata classes this method creates a Schema instance.
public getSchemaFromMetadata ( array $classes ) : Schema
$classes array
리턴 Schema

getUpdateSchemaSql() 공개 메소드

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 getUpdateSchemaSql ( array $classes, $saveMode = false ) : array
$classes array The classes to consider.
리턴 array The sequence of SQL statements.

updateSchema() 공개 메소드

Updates the database schema of the given classes by comparing the ClassMetadata ins$tableNametances to the current database schema that is inspected.
public updateSchema ( array $classes, $saveMode = false ) : void
$classes array
리턴 void