mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
70 lines
1.6 KiB
PHP
70 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace Chill\PersonBundle\Repository\Household;
|
|
|
|
use Chill\PersonBundle\Entity\Household\Position;
|
|
//use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
|
//use Doctrine\Persistence\ManagerRegistry;
|
|
use Doctrine\ORM\EntityManagerInterface;
|
|
use Doctrine\ORM\EntityRepository;
|
|
use Doctrine\Persistence\ObjectRepository;
|
|
|
|
final class PositionRepository implements ObjectRepository
|
|
{
|
|
private EntityRepository $repository;
|
|
|
|
public function __construct(EntityManagerInterface $entityManager)
|
|
{
|
|
$this->repository = $entityManager->getRepository(Position::class);
|
|
}
|
|
|
|
/**
|
|
* @return Position[]
|
|
*/
|
|
public function findAll(): array
|
|
{
|
|
return $this->repository->findAll();
|
|
}
|
|
|
|
/**
|
|
* @return Position[]
|
|
*/
|
|
public function findByActiveOrdered(): array
|
|
{
|
|
return $this->repository->createQueryBuilder('p')
|
|
->select('p')
|
|
->orderBy('p.ordering', 'ASC')
|
|
->getQuery()
|
|
->getResult();
|
|
}
|
|
|
|
/**
|
|
* @return Position[]
|
|
*/
|
|
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array
|
|
{
|
|
return $this->repository->findBy($criteria, $orderBy, $limit, $offset);
|
|
}
|
|
|
|
/**
|
|
* @return Position[]
|
|
*/
|
|
public function findOneBy(array $criteria): array
|
|
{
|
|
return $this->repository->findOneBy($criteria);
|
|
}
|
|
|
|
/**
|
|
* @return Position
|
|
*/
|
|
public function find($id)
|
|
{
|
|
return $this->repository->find($id);
|
|
}
|
|
|
|
public function getClassName()
|
|
{
|
|
return Position::class;
|
|
}
|
|
}
|