How to configure Doctrine using yaml

I rewrote the solution proposed by mahok in http://stackoverflow.com/a/14988359/842697
Change generator
Removed unnecessary code
Change generator strategy
Readd $id

Avoid "Access level to Acme\UserBundle\Entity\User::$id must be protected (as in class FOS\UserBundle\Entity\User) or weaker" when you run `php app/console doctrine:generate:entities AcmeUserBundle` twice.
Removed no neccesary ORM use
Code style
Groups ORM with yaml
Merge pull request #1119 from BraisGabin/patch-1

How to configure Doctrine using yaml