mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
[dev-feature] use an interface for describing CenterRepository (allow mocking in tests
This commit is contained in:
parent
e379d8adb5
commit
38cb1fe357
@ -16,7 +16,7 @@ use Doctrine\ORM\EntityManagerInterface;
|
|||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Doctrine\Persistence\ObjectRepository;
|
use Doctrine\Persistence\ObjectRepository;
|
||||||
|
|
||||||
final class CenterRepository implements ObjectRepository
|
final class CenterRepository implements CenterRepositoryInterface
|
||||||
{
|
{
|
||||||
private EntityRepository $repository;
|
private EntityRepository $repository;
|
||||||
|
|
||||||
@ -30,13 +30,6 @@ final class CenterRepository implements ObjectRepository
|
|||||||
return $this->repository->find($id, $lockMode, $lockVersion);
|
return $this->repository->find($id, $lockMode, $lockVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Return all active centers
|
|
||||||
*
|
|
||||||
* Note: this is a teaser: active will comes later on center entity
|
|
||||||
*
|
|
||||||
* @return Center[]
|
|
||||||
*/
|
|
||||||
public function findActive(): array
|
public function findActive(): array
|
||||||
{
|
{
|
||||||
return $this->findAll();
|
return $this->findAll();
|
||||||
|
@ -0,0 +1,18 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Chill\MainBundle\Repository;
|
||||||
|
|
||||||
|
use Chill\MainBundle\Entity\Center;
|
||||||
|
use Doctrine\Persistence\ObjectRepository;
|
||||||
|
|
||||||
|
interface CenterRepositoryInterface extends ObjectRepository
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Return all active centers
|
||||||
|
*
|
||||||
|
* Note: this is a teaser: active will comes later on center entity
|
||||||
|
*
|
||||||
|
* @return Center[]
|
||||||
|
*/
|
||||||
|
public function findActive(): array;
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user