Symfony2s doctrine:generate:entities doesn't generate repo classes

I am having the same issue

But I've found the answer here: http://brentertainment.com/other/docs/book/doctrine/orm.html

If you have already generated your entity class before adding the repositoryClass mapping, you have to create the class on your own. Fortunately, it’s pretty easy. Simply create the class in the Repository directory of your bundle and be sure it extends Doctrine\ORM\EntityRepository. Once you’ve created the class, you can add any method to query your entities.

Simple, we have to do it by hand because we have already run this once


You can try to specify a particular bundle:

php app/console doctrine:generate:entities AcmeStoreBundle

Note that i have the full bundles name.

This would help even if you run doctrine:generate:entities before.


If you are using orm.yml files to generate your entities, you can define the repositoryClass, and then generate the entities again:

Acme\StoreBundle\Entity\Product:
type: entity
table: product
...
repositoryClass: Acme\StoreBundle\Entity\ProductRepository
...

And then run:

php app/console doctrine:generate:entities AcmeStoreBundle