Let repositories implements ObjectRepository.

This commit is contained in:
Pol Dellaiera
2021-06-23 16:40:43 +02:00
parent df1f44d814
commit 6e37e7feac
5 changed files with 160 additions and 21 deletions

View File

@@ -5,8 +5,9 @@ namespace Chill\PersonBundle\Repository\SocialWork;
use Chill\PersonBundle\Entity\SocialWork\SocialAction;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\Persistence\ObjectRepository;
final class SocialActionRepository
final class SocialActionRepository implements ObjectRepository
{
private EntityRepository $repository;
@@ -14,4 +15,38 @@ final class SocialActionRepository
{
$this->repository = $entityManager->getRepository(SocialAction::class);
}
public function find($id, ?int $lockMode = null, ?int $lockVersion = null): ?SocialAction
{
return $this->repository->find($id, $lockMode, $lockVersion);
}
/**
* @return array<int, SocialAction>
*/
public function findAll(): array
{
return $this->repository->findAll();
}
/**
* @return array<int, SocialAction>
*/
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
public function findOneBy(array $criteria, ?array $orderBy = null): ?SocialAction
{
return $this->repository->findOneBy($criteria, $orderBy);
}
/**
* @return class-string
*/
public function getClassName(): string
{
return SocialAction::class;
}
}