Skip to content

Change the base class for Doctrine repositories #4

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 11, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions src/Resources/skeleton/doctrine/Repository.php.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,18 @@

namespace App\Repository;

use Doctrine\ORM\EntityRepository;
use App\Entity\{{ entity_class_name }};
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\Query;
use Symfony\Bridge\Doctrine\RegistryInterface;

class {{ repository_class_name }} extends EntityRepository
class {{ repository_class_name }} extends ServiceEntityRepository
{
public function __construct(RegistryInterface $registry)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The parent class constructor only expects an instance of Doctrine\Common\Persistence\ManagerRegistry. Do we really want to restrict that here?

{
parent::__construct($registry, {{ entity_class_name }}::class);
}

/*
public function findBySomething($value)
{
Expand Down