Classes:
Doctrine
Doctrine_Access
Doctrine_Adapter
Doctrine_Adapter_Db2_Exception
Doctrine_Adapter_Exception
Doctrine_Adapter_Statement
Doctrine_AuditLog
Doctrine_AuditLog_Listener
Doctrine_Collection
Doctrine_Collection_Exception
Doctrine_Collection_Iterator
Doctrine_Collection_Iterator_Expandable
Doctrine_Collection_Iterator_Normal
Doctrine_Collection_Iterator_Offset
Doctrine_Collection_Offset
Doctrine_Column
Doctrine_Compiler
Doctrine_Compiler_Exception
Doctrine_Configurable
Doctrine_Connection
Doctrine_Connection_Common
Doctrine_Connection_Db2
Doctrine_Connection_Exception
Doctrine_Connection_Firebird
Doctrine_Connection_Firebird_Exception
Doctrine_Connection_Informix
Doctrine_Connection_Informix_Exception
Doctrine_Connection_Mock
Doctrine_Connection_Module
Doctrine_Connection_Mssql
Doctrine_Connection_Mssql_Exception
Doctrine_Connection_Mysql
Doctrine_Connection_Mysql_Exception
Doctrine_Connection_Oracle
Doctrine_Connection_Oracle_Exception
Doctrine_Connection_Pgsql
Doctrine_Connection_Pgsql_Exception
Doctrine_Connection_Profiler
Doctrine_Connection_Profiler_Exception
Doctrine_Connection_Sqlite
Doctrine_Connection_Sqlite_Exception
Doctrine_Connection_Statement
Doctrine_Connection_UnitOfWork
Doctrine_DataDict
Doctrine_DataDict_Exception
Doctrine_DataDict_Informix
Doctrine_DataType
Doctrine_Db
Doctrine_Event
Doctrine_EventListener
Doctrine_EventListener_Chain
Doctrine_EventListener_Exception
Doctrine_Exception
Doctrine_Export
Doctrine_Export_Exception
Doctrine_Export_Firebird
Doctrine_Export_Frontbase
Doctrine_Export_Mssql
Doctrine_Export_Mysql
Doctrine_Export_Oracle
Doctrine_Export_Pgsql
Doctrine_Export_Reporter
Doctrine_Export_Schema
Doctrine_Export_Schema_Xml
Doctrine_Export_Schema_Yml
Doctrine_Export_Sqlite
Doctrine_Expression
Doctrine_Expression_Driver
Doctrine_Expression_Exception
Doctrine_Expression_Firebird
Doctrine_Expression_Informix
Doctrine_Expression_Mock
Doctrine_Expression_Mssql
Doctrine_Expression_Mysql
Doctrine_Expression_Oracle
Doctrine_Expression_Pgsql
Doctrine_Expression_Sqlite
Doctrine_File
Doctrine_File_Index
Doctrine_Formatter
Doctrine_Hook
Doctrine_Hook_Equal
Doctrine_Hook_Integer
Doctrine_Hook_Parser
Doctrine_Hook_Parser_Complex
Doctrine_Hook_WordLike
Doctrine_Hydrate
Doctrine_Hydrate_Array
Doctrine_Hydrate_Exception
Doctrine_Hydrate_Record
Doctrine_Import
Doctrine_Import_Builder
Doctrine_Import_Builder_BaseClass
Doctrine_Import_Builder_Exception
Doctrine_Import_Exception
Doctrine_Import_Firebird
Doctrine_Import_Informix
Doctrine_Import_Mssql
Doctrine_Import_Mysql
Doctrine_Import_Oracle
Doctrine_Import_Pgsql
Doctrine_Import_Reader
Doctrine_Import_Reader_Db
Doctrine_Import_Reader_Exception
Doctrine_Import_Reader_Xml_Propel
Doctrine_Import_Schema
Doctrine_Import_Schema_Xml
Doctrine_Import_Schema_Yml
Doctrine_Import_Sqlite
Doctrine_IntegrityMapper
Doctrine_Lib
Doctrine_Locking_Exception
Doctrine_Locking_Manager_Pessimistic
Doctrine_Manager
Doctrine_Manager_Exception
Doctrine_Node
Doctrine_Node_AdjacencyList
Doctrine_Node_AdjacencyList_LevelOrderIterator
Doctrine_Node_AdjacencyList_PostOrderIterator
Doctrine_Node_AdjacencyList_PreOrderIterator
Doctrine_Node_Exception
Doctrine_Node_MaterializedPath
Doctrine_Node_MaterializedPath_LevelOrderIterator
Doctrine_Node_MaterializedPath_PostOrderIterator
Doctrine_Node_MaterializedPath_PreOrderIterator
Doctrine_Node_NestedSet
Doctrine_Node_NestedSet_LevelOrderIterator
Doctrine_Node_NestedSet_PostOrderIterator
Doctrine_Node_NestedSet_PreOrderIterator
Doctrine_Null
Doctrine_Object
Doctrine_Plugin
Doctrine_Query
Doctrine_Query_Abstract
Doctrine_Query_Check
Doctrine_Query_Condition
Doctrine_Query_Exception
Doctrine_Query_Filter
Doctrine_Query_Filter_Chain
Doctrine_Query_From
Doctrine_Query_Groupby
Doctrine_Query_Having
Doctrine_Query_JoinCondition
Doctrine_Query_Limit
Doctrine_Query_Offset
Doctrine_Query_Orderby
Doctrine_Query_Parser
Doctrine_Query_Part
Doctrine_Query_Select
Doctrine_Query_Set
Doctrine_Query_Where
Doctrine_RawSql
Doctrine_RawSql_Exception
Doctrine_Record
Doctrine_Record_Abstract
Doctrine_Record_Exception
Doctrine_Record_Filter
Doctrine_Record_Iterator
Doctrine_Record_Listener
Doctrine_Record_Listener_Chain
Doctrine_Record_State_Exception
Doctrine_Relation
Doctrine_Relation_Association
Doctrine_Relation_Association_Self
Doctrine_Relation_Exception
Doctrine_Relation_ForeignKey
Doctrine_Relation_LocalKey
Doctrine_Relation_Nest
Doctrine_Relation_Parser
Doctrine_Relation_Parser_Exception
Doctrine_Schema
Doctrine_Schema_Column
Doctrine_Schema_Database
Doctrine_Schema_Exception
Doctrine_Schema_Object
Doctrine_Schema_Relation
Doctrine_Schema_Table
Doctrine_Search
Doctrine_Search_Analyzer
Doctrine_Search_Analyzer_Exception
Doctrine_Search_Analyzer_Standard
Doctrine_Search_Exception
Doctrine_Search_Indexer
Doctrine_Search_Indexer_Dir
Doctrine_Search_Indexer_Exception
Doctrine_Search_Listener
Doctrine_Search_Parser
Doctrine_Search_Query
Doctrine_Search_Record
Doctrine_Search_Scorer
Doctrine_Search_Template
Doctrine_Sequence
Doctrine_Sequence_Db2
Doctrine_Sequence_Exception
Doctrine_Sequence_Firebird
Doctrine_Sequence_Informix
Doctrine_Sequence_Mssql
Doctrine_Sequence_Mysql
Doctrine_Sequence_Oracle
Doctrine_Sequence_Pgsql
Doctrine_Sequence_Sqlite
Doctrine_Table
Doctrine_Table_Exception
Doctrine_Table_Repository
Doctrine_Table_Repository_Exception
Doctrine_Template
Doctrine_Template_NestedSet
Doctrine_Template_Searchable
Doctrine_Template_Taggable
Doctrine_Template_Versionable
Doctrine_Tokenizer
Doctrine_Transaction
Doctrine_Transaction_Exception
Doctrine_Transaction_Firebird
Doctrine_Transaction_Informix
Doctrine_Transaction_Mock
Doctrine_Transaction_Mssql
Doctrine_Transaction_Mysql
Doctrine_Transaction_Oracle
Doctrine_Transaction_Pgsql
Doctrine_Transaction_Sqlite
Doctrine_Tree
Doctrine_Tree_AdjacencyList
Doctrine_Tree_Exception
Doctrine_Tree_MaterializedPath
Doctrine_Tree_NestedSet
Doctrine_Util
Doctrine_Validator
Doctrine_Validator_Country
Doctrine_Validator_Creditcard
Doctrine_Validator_Date
Doctrine_Validator_Email
Doctrine_Validator_Enum
Doctrine_Validator_ErrorStack
Doctrine_Validator_Exception
Doctrine_Validator_HtmlColor
Doctrine_Validator_Ip
Doctrine_Validator_Minlength
Doctrine_Validator_Nospace
Doctrine_Validator_Notblank
Doctrine_Validator_Notnull
Doctrine_Validator_Range
Doctrine_Validator_Regexp
Doctrine_Validator_Unique
Doctrine_Validator_Unsigned
Doctrine_Validator_Usstate
Doctrine_View
Doctrine_View_Exception
Doctrine_Cache
Doctrine_Cache
Doctrine_Cache_Apc
Doctrine_Cache_Array
Doctrine_Cache_Db
Doctrine_Cache_Driver
Doctrine_Cache_Exception
Doctrine_Cache_Memcache
Doctrine_Adapter
Doctrine_Adapter_Db2
Doctrine_Adapter_Mock
Doctrine_Adapter_Mysqli
Doctrine_Adapter_Oracle
Doctrine_Adapter_Statement_Mock
Doctrine_DataDict
Doctrine_DataDict_Firebird
Doctrine_DataDict_Mssql
Doctrine_DataDict_Mysql
Doctrine_DataDict_Oracle
Doctrine_DataDict_Pgsql
Doctrine_DataDict_Sqlite

# Class: Doctrine_Export

Source Location: /Doctrine/Export.php

## Class Doctrine_Export

Class Overview

Doctrine_Export Located in /Doctrine/Export.php [line 34]
    Doctrine_Connection_Module
       |
       --Doctrine_Export
Author(s): Konsta Vesterinen <kvesteri@cc.hut.fi> Lukas Smith <smith@pooteeweet.org> (PEAR MDB2 library) Information Tags:
Version: | $Revision: 2288 $
Link: | www.phpdoctrine.com
Since: | 1.0
License: | LGPL
| Properties $valid_default_values | Methods alterTable alterTableSql createConstraint createConstraintSql createDatabase createDatabaseSql createForeignKeySql createIndex createIndexSql createSequence createSequenceSql createTable createTableSql dropConstraint dropDatabase dropDatabaseSql dropIndex dropIndexSql dropSequence dropSequenceSql dropTable dropTableSql exportClasses exportClassesSql exportSchema exportSql exportTable getAdvancedForeignKeyOptions getCharsetFieldDeclaration getCheckDeclaration getCollationFieldDeclaration getDeclaration getDefaultFieldDeclaration getFieldDeclarationList getForeignKeyBaseDeclaration getForeignKeyDeclaration getForeignKeyReferentialAction getIndexDeclaration getIndexFieldDeclarationList getTemporaryTableQuery getUniqueFieldDeclaration

[ Top ]
Direct descendents

Child Class | Description
--- | ---
Doctrine_Export_Firebird | Doctrine_Export_Sqlite
Doctrine_Export_Frontbase | Doctrine_Export_Frontbase
Doctrine_Export_Mssql | Doctrine_Export_Mssql
Doctrine_Export_Mysql | Doctrine_Export_Mysql
Doctrine_Export_Oracle | Doctrine_Export_Oracle
Doctrine_Export_Pgsql | Doctrine_Export_Pgsql
Doctrine_Export_Sqlite | Doctrine_Export_Sqlite

[ Top ]
Inherited Properties, Constants, and Methods

Inherited Properties | Inherited Methods | Inherited Constants
--- | --- | ---
Inherited From Doctrine_Connection_Module Doctrine_Connection_Module::$conn Doctrine_Connection_Module::$moduleName | Inherited From Doctrine_Connection_Module Doctrine_Connection_Module::__construct() Doctrine_Connection_Module::getConnection() getConnection returns the connection object this module uses Doctrine_Connection_Module::getModuleName() getModuleName returns the name of this module |

[ Top ]
Property Summary

mixed | $valid_default_values |

[ Top ]
Method Summary

void | 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)
void | createConstraint() | create a constraint on a table
void | createConstraintSql() | create a constraint on a table
void | 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 | createForeignKeySql() | createForeignKeySql
void | createIndex() | Get the stucture of a field into an array
string | createIndexSql() | Get the stucture of a field into an array
void | createSequence() | create sequence
string | createSequenceSql() | return RDBMS specific create sequence statement (this method is implemented by the drivers)
void | createTable() | create a new table
string | createTableSql() | create a new table
void | dropConstraint() | drop existing constraint
void | dropDatabase() | drop an existing database (this method is implemented by the drivers)
void | dropDatabaseSql() | drop an existing database (this method is implemented by the drivers)
void | dropIndex() | drop existing index
string | dropIndexSql() | dropIndexSql
void | dropSequence() | dropSequenceSql drop existing sequence (this method is implemented by the drivers)
void | dropSequenceSql() | dropSequenceSql drop existing sequence
void | dropTable() | dropTable drop an existing table
string | dropTableSql() | dropTableSql drop an existing table
void | exportClasses() | exportClasses method for exporting Doctrine_Record classes to a schema
void | exportClassesSql() | exportClassesSql method for exporting Doctrine_Record classes to a schema
void | exportSchema() | exportSchema method for exporting Doctrine_Record classes to a schema
void | exportSql() | exportSql returns the sql for exporting Doctrine_Record classes to a schema
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, ...
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.
void | getForeignKeyReferentialAction() | getForeignKeyReferentialAction
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.
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.

[ Top ]
Properties
mixed $valid_default_values = array(
'text' => '',
'boolean' => true,
'integer' => 0,
'decimal' => 0.0,
'float' => 0.0,
'timestamp' => '1970-01-01 00:00:00',
'time' => '00:00:00',
'date' => '1970-01-01',
'clob' => '',
'blob' => '',
'string' => ''
) [line 36]
API Tags:

Access: | protected

[ Top ]
Methods
alterTable [line 550]

`void alterTable( string $name, $changes, boolean $check )`

alter an existing table (this method is implemented by the drivers)

Parameters:

string | $name: | name of the table that is intended to be changed.
array | $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 for the table. add Associative array with the names of fields to be added as indexes of the array. The value of each entry of the array should be set to another associative array with the properties of the fields to be added. The properties of the fields should be the same as defined by the MDB2 parser. remove Associative array with the names of fields to be removed as indexes of the array. Currently the values assigned to each entry are ignored. An empty array should be used for future compatibility. rename Associative array with the names of fields to be renamed as indexes of the array. The value of each entry of the array should be set to another associative array with the entry named name with the new field name and the entry named Declaration that is expected to contain the portion of the field declaration already in DBMS specific SQL code as it is used in the CREATE TABLE statement. change Associative array with the names of the fields to be changed as indexes of the array. Keep in mind that if it is intended to change either the name of a field and any other properties, the change array entries should have the new names of the fields as array indexes. The value of each entry of the array should be set to another associative array with the properties of the fields to that are meant to be changed as array entries. These entries should be assigned to the new values of the respective properties. The properties of the fields should be the same as defined by the MDB2 parser. Example array( 'name' => 'userlist', 'add' => array( 'quota' => array( 'type' => 'integer', 'unsigned' => 1 ) ), 'remove' => array( 'file_limit' => array(), 'time_limit' => array() ), 'change' => array( 'name' => array( 'length' => '20', 'definition' => array( 'type' => 'text', 'length' => 20, ), ) ), 'rename' => array( 'sex' => array( 'name' => 'gender', 'definition' => array( 'type' => 'text', 'length' => 1, 'default' => 'M', ), ) ) )
boolean | $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.

API Tags:

Access: | public

Redefined in descendants as:

- Doctrine_Export_Firebird::alterTable() : alter an existing table
- Doctrine_Export_Frontbase::alterTable() : alter an existing table
- Doctrine_Export_Mssql::alterTable() : alter an existing table
- Doctrine_Export_Oracle::alterTable() : alter an existing table
- Doctrine_Export_Pgsql::alterTable() : alter an existing table

[ Top ]
alterTableSql [line 566]

`string alterTableSql( string $name, $changes, boolean $check )`

generates the sql for altering an existing table (this method is implemented by the drivers)

Parameters:

string | $name: | name of the table that is intended to be changed.
array | $changes: | associative array that contains the details of each type *
boolean | $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.

API Tags:

See: | Doctrine_Export::alterTable()
Access: | public

Redefined in descendants as:

- Doctrine_Export_Mysql::alterTableSql() : alter an existing table

[ Top ]
createConstraint [line 331]

`void createConstraint( string $table, string $name, array $definition )`

create a constraint on a table

Parameters:

string | $table: | name of the table on which the constraint is to be created
string | $name: | name of the constraint to be created
array | $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 the constraint fields as array constraints. Each entry of this array is set to another type of associative array that specifies properties of the constraint that are specific to each field. Example array( 'fields' => array( 'user_name' => array(), 'last_login' => array() ) )

API Tags:

Access: | public

Redefined in descendants as:

- Doctrine_Export_Firebird::createConstraint() : create a constraint on a table

[ Top ]
createConstraintSql [line 356]

`void createConstraintSql( string $table, string $name, array $definition )`

create a constraint on a table

Parameters:

string | $table: | name of the table on which the constraint is to be created
string | $name: | name of the constraint to be created
array | $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 the constraint fields as array constraints. Each entry of this array is set to another type of associative array that specifies properties of the constraint that are specific to each field. Example array( 'fields' => array( 'user_name' => array(), 'last_login' => array() ) )

API Tags:

Access: | public

[ Top ]
createDatabase [line 165]

`void createDatabase( $database, string $name )`

create a new database (this method is implemented by the drivers)

Parameters:

string | $name: | name of the database that should be created
| $database: |

API Tags:

Access: | public

Redefined in descendants as:

- Doctrine_Export_Firebird::createDatabase() : create a new database
- Doctrine_Export_Mssql::createDatabase() : create a new database
- Doctrine_Export_Oracle::createDatabase() : create a new database

[ Top ]
createDatabaseSql [line 176]

`string createDatabaseSql( $database, string $name )`

create a new database (this method is implemented by the drivers)

Parameters:

string | $name: | name of the database that should be created
| $database: |

API Tags:

Access: | public

Redefined in descendants as:

- Doctrine_Export_Frontbase::createDatabaseSql() : create a new database
- Doctrine_Export_Mysql::createDatabaseSql() : create a new database
- Doctrine_Export_Pgsql::createDatabaseSql() : create a new database

[ Top ]
createForeignKeySql [line 453]

`string createForeignKeySql( string $table, $definition )`

createForeignKeySql

Parameters:

string | $table: | name of the table on which the foreign key is to be created
array | $definition: | associative array that defines properties of the foreign key to be created.

API Tags:

Access: | public

Redefined in descendants as:

- Doctrine_Export_Pgsql::createForeignKeySql() : createForeignKeySql

[ Top ]
createIndex [line 407]

`void createIndex( string $table, string $name, $definition )`

Get the stucture of a field into an array

Parameters:

string | $table: | name of the table on which the index is to be created
string | $name: | name of the index to be created
array | $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 index fields as array indexes. Each entry of this array is set to another type of associative array that specifies properties of the index that are specific to each field. Currently, only the sorting property is supported. It should be used to define the sorting direction of the index. It may be set to either ascending or descending. Not all DBMS support index sorting direction configuration. The DBMS drivers of those that do not support it ignore this property. Use the function supports() to determine whether the DBMS driver can manage indexes. Example array( 'fields' => array( 'user_name' => array( 'sorting' => 'ascending' ), 'last_login' => array() ) )

API Tags:

Access: | public

[ Top ]
createIndexSql [line 420]

`string createIndexSql( string $table, string $name, $definition )`

Get the stucture of a field into an array

Parameters:

string | $table: | name of the table on which the index is to be created
string | $name: | name of the index to be created
array | $definition: | associative array that defines properties of the index to be created.

API Tags:

See: | Doctrine_Export::createIndex()
Access: | public

Redefined in descendants as:

- Doctrine_Export_Firebird::createIndexSql() : Get the stucture of a field into an array
- Doctrine_Export_Mysql::createIndexSql() : Get the stucture of a field into an array
- Doctrine_Export_Sqlite::createIndexSql() : Get the stucture of a field into an array

[ Top ]
createSequence [line 287]

`void createSequence( string $seqName, [string $start = 1], [ $options = array()] )`

create sequence

Parameters:

string | $seqName: | name of the sequence to be created
string | $start: | start value of the sequence; default is 1
array | $options: | An associative array of table options: array( 'comment' => 'Foo', 'charset' => 'utf8', 'collate' => 'utf8_unicode_ci', );

API Tags:

Access: | public

Information Tags:

Throws: | Doctrine_Connection_Exception if something fails at database level

Redefined in descendants as:

- Doctrine_Export_Firebird::createSequence() : create sequence
- Doctrine_Export_Frontbase::createSequence() : create sequence
- Doctrine_Export_Mssql::createSequence() : create sequence
- Doctrine_Export_Mysql::createSequence() : create sequence
- Doctrine_Export_Sqlite::createSequence() : create sequence

[ Top ]
createSequenceSql [line 306]

`string createSequenceSql( string $seqName, [string $start = 1], [ $options = array()] )`

return RDBMS specific create sequence statement (this method is implemented by the drivers)

Parameters:

string | $seqName: | name of the sequence to be created
string | $start: | start value of the sequence; default is 1
array | $options: | An associative array of table options: array( 'comment' => 'Foo', 'charset' => 'utf8', 'collate' => 'utf8_unicode_ci', );

API Tags:

Access: | public

Information Tags:

Throws: | Doctrine_Connection_Exception if something fails at database level

Redefined in descendants as:

- Doctrine_Export_Oracle::createSequenceSql() : create sequence
- Doctrine_Export_Pgsql::createSequenceSql() : return RDBMS specific create sequence statement

[ Top ]
createTable [line 265]

`void createTable( string $name, $fields, [ $options = array()] )`

create a new table

Parameters:

string | $name: | Name of the database that should be created
array | $fields: | Associative array that contains the definition of each field of the new table
array | $options: | An associative array of table options:

API Tags:

See: | Doctrine_Export::createTableSql()
Access: | public

Redefined in descendants as:

- Doctrine_Export_Firebird::createTable() : create a new table
- Doctrine_Export_Oracle::createTable() : create a new table

[ Top ]
createTableSql [line 208]

`string createTableSql( string $name, $fields, [ $options = array()] )`

create a new table

Parameters:

string | $name: | Name of the database that should be created
array | $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 associative arrays like those that are meant to be passed with the field definitions to get[Type]Declaration() functions. array( 'id' => array( 'type' => 'integer', 'unsigned' => 1 'notnull' => 1 'default' => 0 ), 'name' => array( 'type' => 'text', 'length' => 12 ), 'password' => array( 'type' => 'text', 'length' => 12 ) );
array | $options: | An associative array of table options:

API Tags:

Access: | public

Redefined in descendants as:

- Doctrine_Export_Mysql::createTableSql() : create a new table
- Doctrine_Export_Oracle::createTableSql() : create a new table
- Doctrine_Export_Pgsql::createTableSql() : Creates a table.
- Doctrine_Export_Sqlite::createTableSql() : create a new table

[ Top ]
dropConstraint [line 127]

`void dropConstraint( string $table, string $name, [string $primary = false] )`

drop existing constraint

Parameters:

string | $table: | name of table that should be used in method
string | $name: | name of the constraint to be dropped
string | $primary: | hint if the constraint is primary

API Tags:

Access: | public

[ Top ]
dropDatabase [line 57]

`void dropDatabase( $database, string $name )`

drop an existing database (this method is implemented by the drivers)

Parameters:

string | $name: | name of the database that should be dropped
| $database: |

API Tags:

Access: | public

Redefined in descendants as:

- Doctrine_Export_Firebird::dropDatabase() : drop an existing database
- Doctrine_Export_Mssql::dropDatabase() : drop an existing database
- Doctrine_Export_Oracle::dropDatabase() : drop an existing database
- Doctrine_Export_Sqlite::dropDatabase() : drop an existing database

[ Top ]
dropDatabaseSql [line 68]

`void dropDatabaseSql( $database, string $name )`

drop an existing database (this method is implemented by the drivers)

Parameters:

string | $name: | name of the database that should be dropped
| $database: |

API Tags:

Access: | public

Redefined in descendants as:

- Doctrine_Export_Frontbase::dropDatabaseSql() : drop an existing database
- Doctrine_Export_Mysql::dropDatabaseSql() : drop an existing database
- Doctrine_Export_Pgsql::dropDatabaseSql() : drop an existing database

[ Top ]
dropIndex [line 102]

`void dropIndex( string $table, string $name )`

drop existing index

Parameters:

string | $table: | name of table that should be used in method
string | $name: | name of the index to be dropped

API Tags:

Access: | public

[ Top ]
dropIndexSql [line 114]

`string dropIndexSql( string $table, string $name )`

dropIndexSql

Parameters:

string | $table: | name of table that should be used in method
string | $name: | name of the index to be dropped

API Tags:

Return: | SQL that is used for dropping an index
Access: | public

Redefined in descendants as:

- Doctrine_Export_Frontbase::dropIndexSql() : drop existing index
- Doctrine_Export_Mysql::dropIndexSql() : drop existing index

[ Top ]
dropSequence [line 142]

`void dropSequence( string $sequenceName )`

dropSequenceSql drop existing sequence (this method is implemented by the drivers)

Parameters:

string | $sequenceName: | name of the sequence to be dropped

API Tags:

Access: | public

Information Tags:

Throws: | Doctrine_Connection_Exception if something fails at database level

[ Top ]
dropSequenceSql [line 154]

`void dropSequenceSql( string $sequenceName )`

dropSequenceSql drop existing sequence

Parameters:

string | $sequenceName: | name of the sequence to be dropped

API Tags:

Access: | public

Information Tags:

Throws: | Doctrine_Connection_Exception if something fails at database level

Redefined in descendants as:

- Doctrine_Export_Firebird::dropSequenceSql() : drop existing sequence
- Doctrine_Export_Frontbase::dropSequenceSql() : drop existing sequence
- Doctrine_Export_Mssql::dropSequenceSql() : This function drops an existing sequence
- Doctrine_Export_Oracle::dropSequenceSql() : drop existing sequence
- Doctrine_Export_Pgsql::dropSequenceSql() : drop existing sequence
- Doctrine_Export_Sqlite::dropSequenceSql() : drop existing sequence

[ Top ]
dropTable [line 90]

`void dropTable( string $table )`

dropTable drop an existing table

Parameters:

string | $table: | name of table that should be dropped from the database

API Tags:

Access: | public

Redefined in descendants as:

- Doctrine_Export_Firebird::dropTable() : drop an existing table
- Doctrine_Export_Oracle::dropTable() : drop an existing table

[ Top ]
dropTableSql [line 79]

`string dropTableSql( string $table )`

dropTableSql drop an existing table

Parameters:

string | $table: | name of table that should be dropped from the database

API Tags:

Access: | public

Redefined in descendants as:

- Doctrine_Export_Frontbase::dropTableSql() : drop an existing table
- Doctrine_Export_Mysql::dropTableSql() : dropTable

[ Top ]
exportClasses [line 1002]

`void exportClasses( $classes )`

exportClasses method for exporting Doctrine_Record classes to a schema

Parameters:

array | $classes: |

API Tags:

Access: | public

Information Tags:

Throws: | Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS occurred during the create table operation

[ Top ]
exportClassesSql [line 1030]

`void exportClassesSql( $classes )`

exportClassesSql method for exporting Doctrine_Record classes to a schema

Parameters:

array | $classes: |

API Tags:

Access: | public

Information Tags:

Throws: | Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS occurred during the create table operation

[ Top ]
exportSchema [line 974]

`void exportSchema( [string $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 not abstract classes

Parameters:

string | $directory: | optional directory parameter

API Tags:

Access: | public

Information Tags:

Throws: | Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS occurred during the create table operation

[ Top ]
exportSql [line 1080]

`void exportSql( [string $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 not abstract classes

Parameters:

string | $directory: | optional directory parameter

API Tags:

Access: | public

Information Tags:

Throws: | Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS occurred during the create table operation

[ Top ]
exportTable [line 1110]

`boolean exportTable( Doctrine_Table $table )`

exportTable exports given table into database based on column and option definitions

Parameters:

Doctrine_Table | $table: |

API Tags:

Return: | whether or not the export operation was successful false if table already existed in the database
Access: | public

Information Tags:

Throws: | Doctrine_Connection_Exception if some error other than Doctrine::ERR_ALREADY_EXISTS occurred during the create table operation

[ Top ]
getAdvancedForeignKeyOptions [line 848]

`string getAdvancedForeignKeyOptions( $definition )`

getAdvancedForeignKeyOptions Return the FOREIGN KEY query section dealing with non-standard options as MATCH, INITIALLY DEFERRED, ON UPDATE, ...

Parameters:

array | $definition: | foreign key definition

API Tags:

Access: | public

Redefined in descendants as:

- Doctrine_Export_Mysql::getAdvancedForeignKeyOptions() : getAdvancedForeignKeyOptions Return the FOREIGN KEY query section dealing with non-standard options as MATCH, INITIALLY DEFERRED, ON UPDATE, ...
- Doctrine_Export_Oracle::getAdvancedForeignKeyOptions() : getAdvancedForeignKeyOptions Return the FOREIGN KEY query section dealing with non-standard options as MATCH, INITIALLY DEFERRED, ON UPDATE, ...
- Doctrine_Export_Pgsql::getAdvancedForeignKeyOptions() : getAdvancedForeignKeyOptions Return the FOREIGN KEY query section dealing with non-standard options as MATCH, INITIALLY DEFERRED, ON UPDATE, ...
- Doctrine_Export_Sqlite::getAdvancedForeignKeyOptions() : getAdvancedForeignKeyOptions Return the FOREIGN KEY query section dealing with non-standard options as MATCH, INITIALLY DEFERRED, ON UPDATE, ...

[ Top ]
getCharsetFieldDeclaration [line 943]

`string getCharsetFieldDeclaration( string $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.

Parameters:

string | $charset: | name of the charset

API Tags:

Return: | DBMS specific SQL code portion needed to set the CHARACTER SET of a field declaration.
Access: | public

[ Top ]
getCheckDeclaration [line 704]

`string getCheckDeclaration( $definition )`

Obtain DBMS specific SQL code portion needed to set a CHECK constraint declaration to be used in statements like CREATE TABLE.

Parameters:

array | $definition: | check definition

API Tags:

Return: | DBMS specific SQL code portion needed to set a CHECK constraint
Access: | public

[ Top ]
getCollationFieldDeclaration [line 955]

`string getCollationFieldDeclaration( string $collation )`

Obtain DBMS specific SQL code portion needed to set the COLLATION of a field declaration to be used in statements like CREATE TABLE.

Parameters:

string | $collation: | name of the collation

API Tags:

Return: | DBMS specific SQL code portion needed to set the COLLATION of a field declaration.
Access: | public

[ Top ]
getDeclaration [line 640]

`string getDeclaration( string $name, $field )`

Obtain DBMS specific SQL code portion needed to declare a generic type field to be used in statements like CREATE TABLE.

Parameters:

string | $name: | name the field to be declared.
array | $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 value that determines the maximum length of the text field. If this argument is missing the field should be declared to have the longest length allowed by the DBMS. default Text value to be used as default for this field. notnull Boolean flag that indicates whether this field is constrained to not be set to null. charset Text value with the default CHARACTER SET for this field. collation Text value with the default COLLATION for this field. unique unique constraint check column check constraint

API Tags:

Return: | DBMS specific SQL code portion that should be used to declare the specified field.
Access: | public

[ Top ]
getDefaultFieldDeclaration [line 676]

`string getDefaultFieldDeclaration( array $field )`

getDefaultDeclaration Obtain DBMS specific SQL code portion needed to set a default value declaration to be used in statements like CREATE TABLE.

Parameters:

array | $field: | field definition array

API Tags:

Return: | DBMS specific SQL code portion needed to set a default value
Access: | public

Redefined in descendants as:

- Doctrine_Export_Mysql::getDefaultFieldDeclaration() : getDefaultDeclaration Obtain DBMS specific SQL code portion needed to set a default value declaration to be used in statements like CREATE TABLE.

[ Top ]
getFieldDeclarationList [line 599]

`string getFieldDeclarationList( $fields )`

Get declaration of a number of field in bulk

Parameters:

array | $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. Currently, the types of supported field properties are as follows: length Integer value that determines the maximum length of the text field. If this argument is missing the field should be declared to have the longest length allowed by the DBMS. default Text value to be used as default for this field. notnull Boolean flag that indicates whether this field is constrained to not be set to null. charset Text value with the default CHARACTER SET for this field. collation Text value with the default COLLATION for this field. unique unique constraint

API Tags:

Access: | public

[ Top ]
getForeignKeyBaseDeclaration [line 892]

`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.

Parameters:

array | $definition: |

API Tags:

Access: | public

[ Top ]
getForeignKeyDeclaration [line 833]

`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.

Parameters:

array | $definition: | an associative array with the following structure: name optional constraint name local the local field(s) foreign the foreign reference field(s) foreignTable the name of the foreign table onDelete referential delete action onUpdate referential update action deferred deferred constraint checking The onDelete and onUpdate keys accept the following values: CASCADE: Delete or update the row from the parent table and automatically delete or update the matching rows in the child table. Both ON DELETE CASCADE and ON UPDATE CASCADE are supported. Between two tables, you should not define several ON UPDATE CASCADE clauses that act on the same column in the parent table or in the child table. SET NULL: Delete or update the row from the parent table and set the foreign key column or columns in the child table to NULL. This is valid only if the foreign key columns do not have the NOT NULL qualifier specified. Both ON DELETE SET NULL and ON UPDATE SET NULL clauses are supported. NO ACTION: In standard SQL, NO ACTION means no action in the sense that an attempt to delete or update a primary key value is not allowed to proceed if there is a related foreign key value in the referenced table. RESTRICT: Rejects the delete or update operation for the parent table. NO ACTION and RESTRICT are the same as omitting the ON DELETE or ON UPDATE clause. SET DEFAULT

API Tags:

Return: | DBMS specific SQL code portion needed to set the FOREIGN KEY constraint of a field declaration.
Access: | public

[ Top ]
getForeignKeyReferentialAction [line 869]

`void getForeignKeyReferentialAction( string $action, string 1 )`

getForeignKeyReferentialAction

returns given referential action in uppercase if valid, otherwise throws an exception

Parameters:

string | $action: | foreign key referential action
string | 1: | foreign key referential action in uppercase

API Tags:

Access: | public

Information Tags:

Throws: | Doctrine_Exception_Exception if unknown referential action given

[ Top ]
getIndexDeclaration [line 731]

`string getIndexDeclaration( string $name, $definition )`

Obtain DBMS specific SQL code portion needed to set an index declaration to be used in statements like CREATE TABLE.

Parameters:

string | $name: | name of the index
array | $definition: | index definition

API Tags:

Return: | DBMS specific SQL code portion needed to set an index
Access: | public

Redefined in descendants as:

- Doctrine_Export_Mysql::getIndexDeclaration() : Obtain DBMS specific SQL code portion needed to set an index declaration to be used in statements like CREATE TABLE.

[ Top ]
getIndexFieldDeclarationList [line 761]

`string getIndexFieldDeclarationList( $fields )`

getIndexFieldDeclarationList Obtain DBMS specific SQL code portion needed to set an index declaration to be used in statements like CREATE TABLE.

Parameters:

array | $fields: |

API Tags:

Access: | public

Redefined in descendants as:

- Doctrine_Export_Mysql::getIndexFieldDeclarationList() : getIndexFieldDeclarationList Obtain DBMS specific SQL code portion needed to set an index declaration to be used in statements like CREATE TABLE.
- Doctrine_Export_Sqlite::getIndexFieldDeclarationList() : getIndexFieldDeclarationList Obtain DBMS specific SQL code portion needed to set an index declaration to be used in statements like CREATE TABLE.

[ Top ]
getTemporaryTableQuery [line 787]

`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 that requires a different SQL command from "CREATE TEMPORARY TABLE".

API Tags:

Return: | The string required to be placed between "CREATE" and "TABLE" to generate a temporary table, if possible.
Access: | public

Redefined in descendants as:

- Doctrine_Export_Firebird::getTemporaryTableQuery() : A method to return the required SQL string that fits between CREATE ... TABLE to create the table as a temporary table.
- Doctrine_Export_Mssql::getTemporaryTableQuery() : Override the parent method.
- Doctrine_Export_Oracle::getTemporaryTableQuery() : A method to return the required SQL string that fits between CREATE ... TABLE to create the table as a temporary table.

[ Top ]
getUniqueFieldDeclaration [line 931]

`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.

API Tags:

Return: | DBMS specific SQL code portion needed to set the UNIQUE constraint of a field declaration.
Access: | public

[ Top ]