[export] Fixed: the scope aggregator (accompanying course) group by

period's scope (and the label didn't show this)

+ extract ScopeRepository and create ScopeRepositoryInterface
This commit is contained in:
Julien Fastré 2022-10-05 14:46:03 +02:00
parent 307ed4fb1b
commit 491570a21c
4 changed files with 35 additions and 5 deletions

View File

@ -14,9 +14,10 @@ namespace Chill\MainBundle\Repository;
use Chill\MainBundle\Entity\Scope;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\EntityRepository;
use Doctrine\ORM\QueryBuilder;
use Doctrine\Persistence\ObjectRepository;
final class ScopeRepository implements ObjectRepository
final class ScopeRepository implements ScopeRepositoryInterface
{
private EntityRepository $repository;
@ -25,7 +26,7 @@ final class ScopeRepository implements ObjectRepository
$this->repository = $entityManager->getRepository(Scope::class);
}
public function createQueryBuilder($alias, $indexBy = null)
public function createQueryBuilder($alias, $indexBy = null): QueryBuilder
{
return $this->repository->createQueryBuilder($alias, $indexBy);
}
@ -59,7 +60,7 @@ final class ScopeRepository implements ObjectRepository
return $this->repository->findOneBy($criteria, $orderBy);
}
public function getClassName()
public function getClassName(): string
{
return Scope::class;
}

View File

@ -0,0 +1,28 @@
<?php
namespace Chill\MainBundle\Repository;
use Chill\MainBundle\Entity\Scope;
use Doctrine\ORM\QueryBuilder;
use Doctrine\Persistence\ObjectRepository;
interface ScopeRepositoryInterface extends ObjectRepository
{
public function createQueryBuilder($alias, $indexBy = null): QueryBuilder;
public function find($id, $lockMode = null, $lockVersion = null): ?Scope;
/**
* @return Scope[]
*/
public function findAll(): array;
/**
* @return Scope[]
*/
public function findBy(array $criteria, ?array $orderBy = null, $limit = null, $offset = null): array;
public function findOneBy(array $criteria, ?array $orderBy = null): ?Scope;
public function getClassName(): string;
}

View File

@ -83,6 +83,6 @@ final class ScopeAggregator implements AggregatorInterface
public function getTitle(): string
{
return 'Group by user scope';
return 'Group course by scope';
}
}

View File

@ -437,7 +437,8 @@ Filtered by person having an activity between %date_from% and %date_to% with rea
## accompanying course filters/aggr
Filter by user scope: Filtrer les parcours par service du référent
"Filtered by user main scope: only %scope%": "Filtré par service du référent: uniquement %scope%"
Group by user scope: Grouper les parcours par service du référent
Group course by scope: Grouper les parcours par service
Filter by user job: Filtrer les parcours par métier du référent
"Filtered by user job: only %job%": "Filtré par métier du référent: uniquement %job%"