You are currently reading the 1.2 documentation. Switch to 2.2  2.1  2.0 

Defaults Attributes

Doctrine has a few specific attributes available that allow you to specify the default values of things that in the past were hardcoded values. Such as default column length, default column type, etc.

Default Column Options

It is possible to specify an array of default options to be used on every column in your model.

// bootstrap.php

// ...

$manager->setAttribute(Doctrine::ATTR_DEFAULT_COLUMN_OPTIONS,
  array('type' => 'string', 'length' => 255, 'notnull' => true));

Default Added Auto Id

You can customize the properties of the automatically added primary key in Doctrine models.

$manager->setAttribute(Doctrine::ATTR_DEFAULT_IDENTIFIER_OPTIONS,
  array('name' => '%s_id', 'type' => 'string', 'length' => 16));

The %s string in the name is replaced with the table name.


Questions and Feedback

If you find a problem with the documentation or have a suggestion, please register and open a ticket.

If you need support or have a technical question, you can post to the user mailing-list.