doctrine/doctrine2 — pull request #311 by benlumley (2012-03-28 20:07:23+00:00)
Title: Proposal: Support for default attribute in yaml mappings.

There's probably a very good reason you don't already do this... please let me know if there is!

The EntityGenerator supports writing a default value for a property/column when generating a class, but the yaml driver doesn't pick this up. This tiny change makes it work - you can do something like:

Acme\MyBundle\Entity\MyObject:
type: entity
table: my_object
fields:
active:
type: boolean
default: true

and you end up with..

/**
* @var boolean $active
*/
private $active = true;

Similar change would also work for the other drivers I guess.