Home Documentation Download Pricing Buy Now

[Feature Request] Doctrine2 - Generate repository classes

+4 votes

Generate Doctrine2 repository class skeleton in the same way as Symfony 2 task to generate entities does. Make this optional by adding a custom ORM attribute Generate repository class with true/false value.

If MVC framework is Symfony 2 and Generate repository class is set to true, class skeleton in the same namespace should be created. For a class Article in a namespace Acme\MyBundle\Entity a corresponding class should be created:

<?php

namespace Acme\MyBundle\Entity;

use Doctrine\ORM\EntityRepository;

class ArticleRepository extends EntityRepository
{
}

For other MVC frameworks this behavior should be configurable via XML configuration. With the ability to set the namespace and naming conventions.

Further Enhancement -
Ability to automatically generate @ORM\Entity(repositoryClass="XXX") for all entities inside specific module based on filled namespace and entity name.

asked Jun 20, 2013 in Feature Request by frantisek.troster (550 points)
edited Nov 12, 2013 by ludek.vodicka

Please log in or register to answer this question.

...