Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I go with Symfony2 docs. It's said that adding

/**
 * @ORM\Entity(repositoryClass="Acme\StoreBundle\Entity\ProductRepository")
 */

in my entity file and running php app/console doctrine:generate:entities Acme should create the ProductRepository file. It doesn't. I can't clarimy this more, it's just doesnt create that file, just recreates those entity files that were there before.

like image 349
Tomek Buszewski Avatar asked Jan 01 '13 23:01

Tomek Buszewski


1 Answers

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

like image 64
Dave_____1 Avatar answered Oct 23 '22 02:10

Dave_____1