Feature: add a variable active to Scope entity

This commit is contained in:
2022-10-10 16:31:47 +02:00
parent 832f043e25
commit f74f67b5c6
4 changed files with 65 additions and 1 deletions

View File

@@ -43,6 +43,15 @@ final class ScopeRepository implements ScopeRepositoryInterface
return $this->repository->findAll();
}
public function findAllActive(): array
{
$qb = $this->repository->createQueryBuilder('s');
$qb->where('s.active = \'TRUE\'');
return $qb->getQuery()->getResult();
}
/**
* @param mixed|null $limit
* @param mixed|null $offset

View File

@@ -22,10 +22,15 @@ interface ScopeRepositoryInterface extends ObjectRepository
public function find($id, $lockMode = null, $lockVersion = null): ?Scope;
/**
* @return Scope[]
* @return array|Scope[]
*/
public function findAll(): array;
/**
* @return array|Scope[]
*/
public function findAllActive(): array;
/**
* @param null|mixed $limit
* @param null|mixed $offset