Skip to content

Commit afcb4be

Browse files
committed
feature #4 Change the base class for Doctrine repositories (fabpot)
This PR was merged into the master branch. Discussion ---------- Change the base class for Doctrine repositories Commits ------- 4f0114d changed the base class for Doctrine repositories
2 parents a99c3f6 + 4f0114d commit afcb4be

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/Resources/skeleton/doctrine/Repository.php.txt

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,18 @@
22

33
namespace App\Repository;
44

5-
use Doctrine\ORM\EntityRepository;
5+
use App\Entity\{{ entity_class_name }};
6+
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
67
use Doctrine\ORM\Query;
8+
use Symfony\Bridge\Doctrine\RegistryInterface;
79

8-
class {{ repository_class_name }} extends EntityRepository
10+
class {{ repository_class_name }} extends ServiceEntityRepository
911
{
12+
public function __construct(RegistryInterface $registry)
13+
{
14+
parent::__construct($registry, {{ entity_class_name }}::class);
15+
}
16+
1017
/*
1118
public function findBySomething($value)
1219
{

0 commit comments

Comments
 (0)