Element Definitions

Below is a list with all the allowed element names and a brief definition for each one.

Root Elements

Name Description
abstract Whether or not to make the generated class abstract. Defaults to false. When a class is abstract it is not exported to the database.
className Name of the class to generate
tableName Name of the table in your DBMS to use.
connection Name of the Doctrine_Connection instance to bind the model to.
columns Column definitions.
relations Relationship definitions.
indexes Index definitions.
attributes Attribute definitions.
actAs ActAs definitions.
options Option definitions.
inheritance Array for inheritance definition
listeners Array defining listeners to attach
checks Checks to run at application level as well as exporting to your DBMS

Columns

Name Description
name Name of the column.
fixed Whether or not the column is fixed.
primary Whether or not the column is a part of the primary key.
autoincrement Whether or not the column is an autoincrement column.
type Doctrine data type of the column
length Length of the column
default Default value of the column
scale Scale of the column. Used for the decimal type.
values List of values for the enum type.
comment Comment for the column.
sequence Sequence definition for column.
zerofill Whether or not to make the column fill empty characters with zeros
extra Array of extra information to store with the column definition
unsigned Unsigned modifiers for some field definitions, although not all DBMS’s support this modifier for integer field types.

Relations

Name Description
class Name of class to use for relationship.
alias Alias to use to identify relationship.
type The relationship type. Value can be either one or many and it defaults to one.
refClass Middle reference class to use for many to many relationships.
local The local field name used in the relationship.
foreign the foreign field name used in the relationship.
foreignAlias The alias of the opposite end of the relationship. Only allowed when autoComplete is set to true.
foreignType The type of the opposite end of the relationship. Only allowed when autoComplete is set to true.
autoComplete Whether or not to add the relationship to the opposite end making it bi-directional. Defaults to true.
cascade Application level cascading options.
onDelete Database level cascading delete value.
onUpdate Database level cascading update value.
equal Whether or not the relationship is a equal nested many to many.
owningSide
refClassRelationAlias

Inheritance

Name Description
type Type of inheritance to use. Allowed values are concretecolumn_aggregation, and simple.
extends Name of the class to extend.
keyField Name of the field to use as the key for column_aggregation inheritance.
keyValue Value to fill the keyField with for column_aggregation inheritance.

Indexes

Name Description
name Name of the index to create.
fields Array of fields to use in the index.
unique Whether or not the index is unique.
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: