Skip to content
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

Doctrine\Persistence\ManagerRegistry #12

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
10 changes: 2 additions & 8 deletions src/application/Eccube/Repository/BaseInfoRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

namespace Eccube\Repository;

use Doctrine\Persistence\ManagerRegistry as RegistryInterface;
use Eccube\Entity\BaseInfo;

/**
Expand All @@ -24,14 +23,9 @@
*/
class BaseInfoRepository extends AbstractRepository
{
/**
* BaseInfoRepository constructor.
*
* @param RegistryInterface $registry
*/
public function __construct(RegistryInterface $registry)
public function getEntityClass(): string
{
parent::__construct($registry, BaseInfo::class);
return BaseInfo::class;
}

/**
Expand Down
8 changes: 8 additions & 0 deletions src/framework/Eccube/Repository/AbstractRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,18 @@

use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\DBAL\DBALException;
use Doctrine\Persistence\ManagerRegistry;
use Eccube\Entity\AbstractEntity;

abstract class AbstractRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
{
parent::__construct($registry, $this->getEntityClass());
}

abstract public function getEntityClass(): string;

/**
* @var array
*/
Expand Down