title: Default column value with Doctrine2 and Symfony2 using YAML?
body: <p>Using <strong>annotations</strong> is quite simple to set a default value for a given column and initialize collections for entity relations:</p>
  
  <pre><code>use Doctrine\Common\Collections\ArrayCollection;
  
  class Category
  {   
      /**
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      protected $id;
  
      /**
       * @ORM\OneToMany(targetEntity="Product", mappedBy="category")
       */
      protected $products;
  
      /**
       * @ORM\Column(type="bool")
       */
      protected $is_visible;
  
      public function __construct()
      {
          $this-&gt;products   = new ArrayCollection();
          $this-&gt;is_visible = true; // Default value for column is_visible
      }
  }
  </code></pre>
  
  <p>How the same can be achieved using <strong>YAML</strong> definition instead, without manually write <code>Category.php</code>? Is <code>__construct()</code> the only method for doing this?</p>
  
  <pre><code>Acme\StoreBundle\Entity\Category:
      type: entity
      id:
          id:
              type: integer
              generator: { strategy: AUTO }
      fields:
          is_visible:
              type: bool
      oneToMany:
          products:
              targetEntity: Product
              mappedBy: category
  </code></pre>