mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
59 lines
1.5 KiB
PHP
59 lines
1.5 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Chill\MainBundle\Repository;
|
|
|
|
use Chill\MainBundle\Entity\AddressReference;
|
|
use Doctrine\ORM\EntityManagerInterface;
|
|
use Doctrine\ORM\EntityRepository;
|
|
use Doctrine\Persistence\ObjectRepository;
|
|
|
|
final class AddressReferenceRepository implements ObjectRepository
|
|
{
|
|
private EntityRepository $repository;
|
|
|
|
public function __construct(EntityManagerInterface $entityManager)
|
|
{
|
|
$this->repository = $entityManager->getRepository(AddressReference::class);
|
|
}
|
|
|
|
public function find($id, $lockMode = null, $lockVersion = null): ?AddressReference
|
|
{
|
|
return $this->repository->find($id, $lockMode, $lockVersion);
|
|
}
|
|
|
|
public function findOneBy(array $criteria, array $orderBy = null): ?AddressReference
|
|
{
|
|
return $this->repository->findOneBy($criteria, $orderBy);
|
|
}
|
|
|
|
/**
|
|
* @return AddressReference[]
|
|
*/
|
|
public function findAll(): array
|
|
{
|
|
return $this->repository->findAll();
|
|
}
|
|
|
|
public function countAll(): int
|
|
{
|
|
$qb = $this->repository->createQueryBuilder('ar');
|
|
$qb->select('count(ar.id)');
|
|
|
|
return $qb->getQuery()->getSingleScalarResult();
|
|
}
|
|
|
|
/**
|
|
* @return AddressReference[]
|
|
*/
|
|
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null): array
|
|
{
|
|
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
|
}
|
|
|
|
public function getClassName() {
|
|
return AddressReference::class;
|
|
}
|
|
}
|