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

使用声明 | 英豪名录