0.10 Doctrine_Export
Doctrine Export
Inheritence
Doctrine_Export < Doctrine_Connection_Module
Direct Sub-Classes
- Doctrine_Export_Firebird: Doctrine_Export_Sqlite
Method Summary
| Returns | Name | Description |
|---|---|---|
| alterTable | ||
| string | alterTableSql | |
| createConstraint | ||
| createConstraintSql | ||
| createDatabase | ||
| string | createDatabaseSql | |
| string | createForeignKey | |
| string | createForeignKeySql | |
| createIndex | ||
| string | createIndexSql | |
| createSequence | ||
| string | createSequenceSql | |
| createTable | ||
| string | createTableSql | |
| dropConstraint | ||
| dropDatabase | ||
| dropDatabaseSql | ||
| dropForeignKey | ||
| dropIndex | ||
| string | dropIndexSql | |
| dropSequence | ||
| dropSequenceSql | ||
| dropTable | ||
| string | dropTableSql | |
| exportClasses | FIXME: This function has ugly hacks in it to make sure sql is inserted in the correct order. | |
| exportClassesSql | ||
| array | exportGeneratorsSql | |
| exportSchema | if the directory parameter is given this method first iterates recursively trhough the given directory in order to find any model classes Then it iterates through all declared classes and creates tables for the ones that extend Doctrine_Record and are n | |
| exportSql | if the directory parameter is given this method first iterates recursively trhough the given directory in order to find any model classes Then it iterates through all declared classes and creates tables for the ones that extend Doctrine_Record and are n | |
| boolean | exportTable | |
| string | getAdvancedForeignKeyOptions | |
| array | getAllGenerators | |
| string | getCharsetFieldDeclaration | |
| string | getCheckDeclaration | |
| string | getCollationFieldDeclaration | |
| string | getDeclaration | |
| string | getDefaultFieldDeclaration | |
| string | getFieldDeclarationList | |
| string | getForeignKeyBaseDeclaration | |
| string | getForeignKeyDeclaration | |
| getForeignKeyReferentialAction | returns given referential action in uppercase if valid, otherwise throws an exception | |
| string | getIndexDeclaration | |
| string | getIndexFieldDeclarationList | |
| string | getTemporaryTableQuery | Should be overridden in driver classes to return the correct string for the specific database type. The default is to return the string "TEMPORARY" - this will result in a SQL error for any database that does not support temporary tables, or t |
| string | getUniqueFieldDeclaration |
Method Details
-
$name name of the table that is intended to be changed. $changes associative array that contains the details of each type of change that is intended to be performed. The types of changes that are currently supported are defined as follows:
name
New name f
$check indicates whether the function should just check if the DBMS driver can perform the requested table alterations if the value is true or actually perform them otherwise. alterTable($name, $changes, $check = false)
alter an existing table (this method is implemented by the drivers)
-
$name name of the table that is intended to be changed. $changes associative array that contains the details of each type * $check indicates whether the function should just check if the DBMS driver can perform the requested table alterations if the value is true or actually perform them otherwise. (string) alterTableSql($name, $changes, $check = false)
generates the sql for altering an existing table (this method is implemented by the drivers)
-
$table name of the table on which the constraint is to be created $name name of the constraint to be created $definition associative array that defines properties of the constraint to be created. Currently, only one property named FIELDS is supported. This property is also an associative with the names of
createConstraint($table, $name, $definition)
create a constraint on a table
-
$table name of the table on which the constraint is to be created $name name of the constraint to be created $definition associative array that defines properties of the constraint to be created. Currently, only one property named FIELDS is supported. This property is also an associative with the names of
createConstraintSql($table, $name, $definition)
create a constraint on a table
-
$name name of the database that should be created createDatabase($database, $name)
create a new database (this method is implemented by the drivers)
-
$name name of the database that should be created (string) createDatabaseSql($database, $name)
create a new database (this method is implemented by the drivers)
-
$table name of the table on which the foreign key is to be created $definition associative array that defines properties of the foreign key to be created. (string) createForeignKey($table, $definition)
-
$table name of the table on which the foreign key is to be created $definition associative array that defines properties of the foreign key to be created. (string) createForeignKeySql($table, $definition)
-
$table name of the table on which the index is to be created $name name of the index to be created $definition associative array that defines properties of the index to be created. Currently, only one property named FIELDS is supported. This property is also an associative with the names of the i
createIndex($table, $name, $definition)
Get the stucture of a field into an array
-
$table name of the table on which the index is to be created $name name of the index to be created $definition associative array that defines properties of the index to be created. (string) createIndexSql($table, $name, $definition)
Get the stucture of a field into an array
-
$seqName name of the sequence to be created $start start value of the sequence; default is 1 $options An associative array of table options: array( 'comment' => 'Foo', 'charset' => 'utf8', 'collate' => 'utf8_unicode_ci', ); createSequence($seqName, $start = 1, $options = array())
create sequence
throws Doctrine_Connection_Exception if something fails at database level
-
$seqName name of the sequence to be created $start start value of the sequence; default is 1 $options An associative array of table options: array( 'comment' => 'Foo', 'charset' => 'utf8', 'collate' => 'utf8_unicode_ci', ); (string) createSequenceSql($seqName, $start = 1, $options = array())
return RDBMS specific create sequence statement (this method is implemented by the drivers)
throws Doctrine_Connection_Exception if something fails at database level
-
$name Name of the database that should be created $fields Associative array that contains the definition of each field of the new table $options An associative array of table options: createTable($name, $fields, $options = array())
create a new table
-
$name Name of the database that should be created $fields Associative array that contains the definition of each field of the new table The indexes of the array entries are the names of the fields of the table an the array entry values are associ $options An associative array of table options: (string) createTableSql($name, $fields, $options = array())
create a new table
-
$table name of table that should be used in method $name name of the constraint to be dropped $primary hint if the constraint is primary dropConstraint($table, $name, $primary = false)
drop existing constraint
-
$name name of the database that should be dropped dropDatabase($database, $name)
drop an existing database (this method is implemented by the drivers)
-
$name name of the database that should be dropped dropDatabaseSql($database, $name)
drop an existing database (this method is implemented by the drivers)
-
$table name of table that should be used in method $name name of the foreign key to be dropped dropForeignKey($table, $name)
drop existing foreign key
-
$table name of table that should be used in method $name name of the index to be dropped dropIndex($table, $name)
drop existing index
-
$table name of table that should be used in method $name name of the index to be dropped (string) dropIndexSql($table, $name)
Doctrine_Export
-
$sequenceName name of the sequence to be dropped dropSequence($sequenceName)
dropSequenceSql drop existing sequence (this method is implemented by the drivers)
throws Doctrine_Connection_Exception if something fails at database level
-
$sequenceName name of the sequence to be dropped dropSequenceSql($sequenceName)
dropSequenceSql drop existing sequence
throws Doctrine_Connection_Exception if something fails at database level
-
$table name of table that should be dropped from the database dropTable($table)
dropTable drop an existing table
-
$table name of table that should be dropped from the database (string) dropTableSql($table)
dropTableSql drop an existing table
-
exportClasses($classes)
exportClasses method for exporting Doctrine_Record classes to a schema
FIXME: This function has ugly hacks in it to make sure sql is inserted in the correct order.
throws Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS occurred during the create table operation
-
exportClassesSql($classes)
exportClassesSql method for exporting Doctrine_Record classes to a schema
throws Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS occurred during the create table operation
-
$table the table in which the generators belong to (array) exportGeneratorsSql(( ) $table)
exportGeneratorsSql exports plugin tables for given table
Doctrine_Export
-
$directory optional directory parameter exportSchema($directory = null)
exportSchema method for exporting Doctrine_Record classes to a schema
if the directory parameter is given this method first iterates recursively trhough the given directory in order to find any model classes
Then it iterates through all declared classes and creates tables for the ones that extend Doctrine_Record and are nthrows Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS occurred during the create table operation
-
$directory optional directory parameter exportSql($directory = null)
exportSql returns the sql for exporting Doctrine_Record classes to a schema
if the directory parameter is given this method first iterates recursively trhough the given directory in order to find any model classes
Then it iterates through all declared classes and creates tables for the ones that extend Doctrine_Record and are nthrows Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS occurred during the create table operation
-
(boolean) exportTable(( ) $table)
exportTable exports given table into database based on column and option definitions
Doctrine_Export
throws Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS occurred during the create table operation
-
$definition foreign key definition (string) getAdvancedForeignKeyOptions($definition)
getAdvancedForeignKeyOptions Return the FOREIGN KEY query section dealing with non-standard options as MATCH, INITIALLY DEFERRED, ON UPDATE, ...
-
$table table object to retrieve the generators from (array) getAllGenerators(( ) $table)
fetches all generators recursively for given table
Doctrine_Export
-
$charset name of the charset (string) getCharsetFieldDeclaration($charset)
Obtain DBMS specific SQL code portion needed to set the CHARACTER SET of a field declaration to be used in statements like CREATE TABLE.
Doctrine_Export
-
$definition check definition (string) getCheckDeclaration($definition)
Obtain DBMS specific SQL code portion needed to set a CHECK constraint declaration to be used in statements like CREATE TABLE.
Doctrine_Export
-
$collation name of the collation (string) getCollationFieldDeclaration($collation)
Obtain DBMS specific SQL code portion needed to set the COLLATION of a field declaration to be used in statements like CREATE TABLE.
Doctrine_Export
-
$name name the field to be declared. $field associative array with the name of the properties of the field being declared as array indexes. Currently, the types of supported field properties are as follows:
length Integer val
(string) getDeclaration($name, $field)
Obtain DBMS specific SQL code portion needed to declare a generic type field to be used in statements like CREATE TABLE.
Doctrine_Export
-
$field field definition array (string) getDefaultFieldDeclaration($field)
getDefaultDeclaration Obtain DBMS specific SQL code portion needed to set a default value declaration to be used in statements like CREATE TABLE.
Doctrine_Export
-
$fields a multidimensional associative array. The first dimension determines the field name, while the second dimension is keyed with the name of the properties of the field being declared as array indexes. Cu
(string) getFieldDeclarationList($fields)
Get declaration of a number of field in bulk
-
(string) getForeignKeyBaseDeclaration($definition)
getForeignKeyBaseDeclaration Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint of a field declaration to be used in statements like CREATE TABLE.
-
$definition an associative array with the following structure: name optional constraint name
local the local field(s)
foreign the foreign reference field(s)
for
(string) getForeignKeyDeclaration($definition)
getForeignKeyDeclaration Obtain DBMS specific SQL code portion needed to set the FOREIGN KEY constraint of a field declaration to be used in statements like CREATE TABLE.
Doctrine_Export
-
$action foreign key referential action 1 foreign key referential action in uppercase getForeignKeyReferentialAction($action, 1)
returns given referential action in uppercase if valid, otherwise throws an exception
throws Doctrine_Exception_Exception if unknown referential action given
-
$name name of the index $definition index definition (string) getIndexDeclaration($name, $definition)
Obtain DBMS specific SQL code portion needed to set an index declaration to be used in statements like CREATE TABLE.
Doctrine_Export
-
(string) getIndexFieldDeclarationList($fields)
getIndexFieldDeclarationList Obtain DBMS specific SQL code portion needed to set an index declaration to be used in statements like CREATE TABLE.
-
(string) getTemporaryTableQuery()
A method to return the required SQL string that fits between CREATE ... TABLE to create the table as a temporary table.
Should be overridden in driver classes to return the correct string for the specific database type.
The default is to return the string "TEMPORARY" - this will result in a SQL error for any database that does not support temporary tables, or tDoctrine_Export
-
(string) getUniqueFieldDeclaration()
Obtain DBMS specific SQL code portion needed to set the UNIQUE constraint of a field declaration to be used in statements like CREATE TABLE.
Doctrine_Export