Symfony doctrine: generate: entities do not generate repo classes

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

/**
 * @ORMEntity(repositoryClass="AcmeStoreBundleEntityProductRepository")
 */

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.

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 DoctrineORMEntityRepository. 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

Hello, buddy!稿源:Hello, buddy! (源链) | 关于 | 阅读提示

本站遵循[CC BY-NC-SA 4.0]。如您有版权、意见投诉等问题,请通过eMail联系我们处理。
酷辣虫 » 综合编程 » Symfony doctrine: generate: entities do not generate repo classes

喜欢 (0)or分享给?

专业 x 专注 x 聚合 x 分享 CC BY-NC-SA 4.0

使用声明 | 英豪名录