[Feature] add active property to evaluation

This commit is contained in:
2022-10-13 15:22:48 +02:00
parent 1ba9f0365f
commit 5a94ce49f1
7 changed files with 201 additions and 4 deletions

View File

@@ -14,9 +14,8 @@ namespace Chill\PersonBundle\Repository\SocialWork;
use Chill\PersonBundle\Entity\SocialWork\Evaluation;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\Persistence\ObjectRepository;
final class EvaluationRepository implements ObjectRepository
final class EvaluationRepository implements EvaluationRepositoryInterface
{
private EntityRepository $repository;
@@ -38,6 +37,11 @@ final class EvaluationRepository implements ObjectRepository
return $this->repository->findAll();
}
public function findAllActive(): array
{
return $this->findBy(['active' => true]);
}
/**
* @param mixed|null $limit
* @param mixed|null $offset

View File

@@ -0,0 +1,45 @@
<?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\PersonBundle\Repository\SocialWork;
use Chill\PersonBundle\Entity\SocialWork\Evaluation;
use Doctrine\Persistence\ObjectRepository;
interface EvaluationRepositoryInterface extends ObjectRepository
{
public function find($id, ?int $lockMode = null, ?int $lockVersion = null): ?Evaluation;
/**
* @return array<int, Evaluation>
*/
public function findAll(): array;
/**
* @return array<int, Evaluation>
*/
public function findAllActive(): array;
/**
* @param mixed|null $limit
* @param mixed|null $offset
*
* @return array<int, Evaluation>
*/
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array;
public function findOneBy(array $criteria, ?array $orderBy = null): ?Evaluation;
/**
* @return class-string
*/
public function getClassName(): string;
}