You are currently viewing the 0.10 version of the API documentation. Switch to 2.0 or 1.0 or 1.1 or 1.2.

Doctrine Export

Inheritence

Doctrine_Export > Doctrine_Connection_Module

Direct Sub-Classes

Method Summary

Returns Name Description
alterTable alter an existing table (this method is implemented by the drivers)
string alterTableSql generates the sql for altering an existing table (this method is implemented by the drivers)
createConstraint create a constraint on a table
createConstraintSql create a constraint on a table
createDatabase create a new database (this method is implemented by the drivers)
string createDatabaseSql create a new database (this method is implemented by the drivers)
string createForeignKey
string createForeignKeySql
createIndex Get the stucture of a field into an array
string createIndexSql Get the stucture of a field into an array
createSequence create sequence
string createSequenceSql return RDBMS specific create sequence statement (this method is implemented by the drivers)
createTable create a new table
string createTableSql create a new table
dropConstraint drop existing constraint
dropDatabase drop an existing database (this method is implemented by the drivers)
dropDatabaseSql drop an existing database (this method is implemented by the drivers)
dropForeignKey drop existing foreign key
dropIndex drop existing index
string dropIndexSql
dropSequence dropSequenceSql drop existing sequence (this method is implemented by the drivers)
dropSequenceSql dropSequenceSql drop existing sequence
dropTable dropTable drop an existing table
string dropTableSql dropTableSql drop an existing table
exportClasses 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.
exportClassesSql exportClassesSql method for exporting Doctrine_Record classes to a schema
array exportGeneratorsSql exportGeneratorsSql exports plugin tables for given table
exportSchema 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 n
exportSql 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 n
boolean exportTable exportTable exports given table into database based on column and option definitions
string getAdvancedForeignKeyOptions getAdvancedForeignKeyOptions Return the FOREIGN KEY query section dealing with non-standard options as MATCH, INITIALLY DEFERRED, ON UPDATE, ...
array getAllGenerators fetches all generators recursively for given table
string getCharsetFieldDeclaration Obtain DBMS specific SQL code portion needed to set the CHARACTER SET of a field declaration to be used in statements like CREATE TABLE.
string getCheckDeclaration Obtain DBMS specific SQL code portion needed to set a CHECK constraint declaration to be used in statements like CREATE TABLE.
string getCollationFieldDeclaration Obtain DBMS specific SQL code portion needed to set the COLLATION of a field declaration to be used in statements like CREATE TABLE.
string getDeclaration Obtain DBMS specific SQL code portion needed to declare a generic type field to be used in statements like CREATE TABLE.
string getDefaultFieldDeclaration getDefaultDeclaration Obtain DBMS specific SQL code portion needed to set a default value declaration to be used in statements like CREATE TABLE.
string getFieldDeclarationList Get declaration of a number of field in bulk
string getForeignKeyBaseDeclaration 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.
string getForeignKeyDeclaration 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.
getForeignKeyReferentialAction returns given referential action in uppercase if valid, otherwise throws an exception
string getIndexDeclaration Obtain DBMS specific SQL code portion needed to set an index declaration to be used in statements like CREATE TABLE.
string getIndexFieldDeclarationList 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 t
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.

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)

    returns SQL that is used for dropping an index


  • $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

    returns an array of sql strings


  • $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 n

    throws 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 n

    throws 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

    returns whether or not the export operation was successful false if table already existed in the database

    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

    returns an array of Doctrine_Record_Generator objects


  • $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.

    returns DBMS specific SQL code portion needed to set the CHARACTER SET of a field declaration.


  • $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.

    returns DBMS specific SQL code portion needed to set a CHECK constraint


  • $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.

    returns DBMS specific SQL code portion needed to set the COLLATION of a field declaration.


  • $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.

    returns DBMS specific SQL code portion that should be used to declare the specified field.


  • $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.

    returns DBMS specific SQL code portion needed to set a default value


  • $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.

    returns DBMS specific SQL code portion needed to set the FOREIGN KEY constraint of a field declaration.


  • $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.

    returns DBMS specific SQL code portion needed to set an index


  • (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 t

    returns The string required to be placed between "CREATE" and "TABLE" to generate a temporary table, if possible.


  • (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.

    returns DBMS specific SQL code portion needed to set the UNIQUE constraint of a field declaration.