mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-21 07:03:49 +00:00
ajout compteurs
This commit is contained in:
@@ -15,6 +15,7 @@ use Chill\DocGeneratorBundle\Entity\DocGeneratorTemplate;
|
||||
use Chill\DocGeneratorBundle\Repository\DocGeneratorTemplateRepository;
|
||||
use Chill\MainBundle\Pagination\PaginatorFactory;
|
||||
use Chill\MainBundle\Serializer\Model\Collection;
|
||||
use Chill\MainBundle\Serializer\Model\Counter;
|
||||
use Chill\PersonBundle\Entity\AccompanyingPeriod\AccompanyingPeriodWorkEvaluation;
|
||||
use Chill\PersonBundle\Entity\SocialWork\Evaluation;
|
||||
use Chill\PersonBundle\Repository\AccompanyingPeriod\AccompanyingPeriodWorkEvaluationRepository;
|
||||
@@ -95,6 +96,16 @@ class AccompanyingPeriodWorkEvaluationApiController
|
||||
{
|
||||
$total = $this->accompanyingPeriodWorkEvaluationRepository
|
||||
->countNearMaxDateByUser($this->security->getUser());
|
||||
|
||||
if ($request->query->getBoolean('countOnly', false)) {
|
||||
return new JsonResponse(
|
||||
$this->serializer->serialize(new Counter($total), 'json', ['groups' => 'read']),
|
||||
JsonResponse::HTTP_OK,
|
||||
[],
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$paginator = $this->paginatorFactory->create($total);
|
||||
$works = $this->accompanyingPeriodWorkEvaluationRepository
|
||||
->findNearMaxDateByUser(
|
||||
|
Reference in New Issue
Block a user