mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-20 22:53:49 +00:00
[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:
@@ -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;
|
||||
}
|
||||
|
@@ -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;
|
||||
}
|
Reference in New Issue
Block a user