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

@@ -1,9 +1,10 @@
<?php
declare(strict_types=1);
namespace Chill\PersonBundle\Repository\SocialWork;
use Chill\PersonBundle\Entity\SocialWork\SocialIssue;
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\Persistence\ObjectRepository;
@@ -17,42 +18,36 @@ final class SocialIssueRepository implements ObjectRepository
$this->repository = $entityManager->getRepository(SocialIssue::class);
}
/**
* {@inheritDoc}
*/
public function find($id)
public function find($id, ?int $lockMode = null, ?int $lockVersion = null): ?SocialIssue
{
return $this->repository->find($id);
return $this->repository->find($id, $lockMode, $lockVersion);
}
/**
* {@inheritDoc}
* @return array<int, SocialIssue>
*/
public function findAll()
public function findAll(): array
{
return $this->repository->findAll();
}
/**
* {@inheritDoc}
* @return array<int, SocialIssue>
*/
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null)
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
{
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
}
/**
* {@inheritDoc}
*/
public function findOneBy(array $criteria)
public function findOneBy(array $criteria, ?array $orderBy = null): ?SocialIssue
{
return $this->findOneBy($criteria);
return $this->repository->findOneBy($criteria, $orderBy);
}
/**
* {@inheritDoc}
* @return class-string
*/
public function getClassName()
public function getClassName(): string
{
return SocialIssue::class;
}