mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
Merge branch 'master' into upgrade-php82
This commit is contained in:
@@ -14,9 +14,8 @@ namespace Chill\BudgetBundle\Repository;
|
||||
use Chill\BudgetBundle\Entity\ChargeKind;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
|
||||
class ChargeKindRepository implements ObjectRepository
|
||||
final class ChargeKindRepository implements ChargeKindRepositoryInterface
|
||||
{
|
||||
private EntityRepository $repository;
|
||||
|
||||
@@ -50,7 +49,8 @@ class ChargeKindRepository implements ObjectRepository
|
||||
->where($qb->expr()->eq('c.isActive', 'true'))
|
||||
->orderBy('c.ordering', 'ASC')
|
||||
->getQuery()
|
||||
->getResult();
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,6 +77,11 @@ class ChargeKindRepository implements ObjectRepository
|
||||
return $this->repository->findOneBy($criteria);
|
||||
}
|
||||
|
||||
public function findOneByKind(string $kind): ?ChargeKind
|
||||
{
|
||||
return $this->repository->findOneBy(['kind' => $kind]);
|
||||
}
|
||||
|
||||
public function getClassName(): string
|
||||
{
|
||||
return ChargeKind::class;
|
||||
|
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\BudgetBundle\Repository;
|
||||
|
||||
use Chill\BudgetBundle\Entity\ChargeKind;
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
|
||||
interface ChargeKindRepositoryInterface extends ObjectRepository
|
||||
{
|
||||
public function find($id): ?ChargeKind;
|
||||
|
||||
/**
|
||||
* @return ChargeType[]
|
||||
*/
|
||||
public function findAll(): array;
|
||||
|
||||
/**
|
||||
* @return ChargeType[]
|
||||
*/
|
||||
public function findAllActive(): array;
|
||||
|
||||
public function findOneByKind(string $kind): ?ChargeKind;
|
||||
|
||||
/**
|
||||
* @return ChargeType[]
|
||||
*/
|
||||
public function findAllByType(string $type): array;
|
||||
|
||||
/**
|
||||
* @param mixed|null $limit
|
||||
* @param mixed|null $offset
|
||||
*
|
||||
* @return ChargeType[]
|
||||
*/
|
||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array;
|
||||
|
||||
public function findOneBy(array $criteria): ?ChargeKind;
|
||||
|
||||
public function getClassName(): string;
|
||||
}
|
@@ -14,9 +14,8 @@ namespace Chill\BudgetBundle\Repository;
|
||||
use Chill\BudgetBundle\Entity\ResourceKind;
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use Doctrine\ORM\EntityRepository;
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
|
||||
class ResourceKindRepository implements ObjectRepository
|
||||
final class ResourceKindRepository implements ResourceKindRepositoryInterface
|
||||
{
|
||||
private EntityRepository $repository;
|
||||
|
||||
@@ -50,7 +49,8 @@ class ResourceKindRepository implements ObjectRepository
|
||||
->where($qb->expr()->eq('r.isActive', 'true'))
|
||||
->orderBy('r.ordering', 'ASC')
|
||||
->getQuery()
|
||||
->getResult();
|
||||
->getResult()
|
||||
;
|
||||
}
|
||||
|
||||
public function findOneByKind(string $kind): ?ResourceKind
|
||||
@@ -82,6 +82,11 @@ class ResourceKindRepository implements ObjectRepository
|
||||
return $this->repository->findOneBy($criteria);
|
||||
}
|
||||
|
||||
public function findOneByKind(string $kind): ?ResourceKind
|
||||
{
|
||||
return $this->repository->findOneBy(['kind' => $kind]);
|
||||
}
|
||||
|
||||
public function getClassName(): string
|
||||
{
|
||||
return ResourceKind::class;
|
||||
|
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/*
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\BudgetBundle\Repository;
|
||||
|
||||
use Chill\BudgetBundle\Entity\ResourceKind;
|
||||
use Doctrine\Persistence\ObjectRepository;
|
||||
|
||||
interface ResourceKindRepositoryInterface extends ObjectRepository
|
||||
{
|
||||
public function find($id): ?ResourceKind;
|
||||
|
||||
/**
|
||||
* @return ResourceType[]
|
||||
*/
|
||||
public function findAll(): array;
|
||||
|
||||
/**
|
||||
* @return ResourceType[]
|
||||
*/
|
||||
public function findAllActive(): array;
|
||||
|
||||
/**
|
||||
* @return ResourceType[]
|
||||
*/
|
||||
public function findAllByType(string $type): array;
|
||||
|
||||
/**
|
||||
* @param mixed|null $limit
|
||||
* @param mixed|null $offset
|
||||
*
|
||||
* @return ResourceType[]
|
||||
*/
|
||||
public function findBy(array $criteria, ?array $orderBy = null, ?int $limit = null, ?int $offset = null): array;
|
||||
|
||||
public function findOneBy(array $criteria): ?ResourceKind;
|
||||
|
||||
public function findOneByKind(string $kind): ?ResourceKind;
|
||||
|
||||
public function getClassName(): string;
|
||||
}
|
@@ -34,7 +34,7 @@ class ResourceRepository extends EntityRepository
|
||||
//->andWhere('c.startDate < :date')
|
||||
// TODO: there is a misconception here, the end date must be lower or null. startDate are never null
|
||||
//->andWhere('c.startDate < :date OR c.startDate IS NULL');
|
||||
;
|
||||
;
|
||||
|
||||
if (null !== $sort) {
|
||||
$qb->orderBy($sort);
|
||||
|
Reference in New Issue
Block a user