Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
| Total | |
100.00% |
7 / 7 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
1 / 1 |
| StoreRepository | |
100.00% |
7 / 7 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
1 / 1 |
| __construct | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |||
| getActive | |
100.00% |
6 / 6 |
|
100.00% |
1 / 1 |
1 | |||
| 1 | <?php |
| 2 | |
| 3 | declare(strict_types=1); |
| 4 | |
| 5 | namespace App\Repository; |
| 6 | |
| 7 | use App\Entity\Store; |
| 8 | use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; |
| 9 | use Doctrine\Persistence\ManagerRegistry; |
| 10 | |
| 11 | /** |
| 12 | * @method Store|null find($id, $lockMode = null, $lockVersion = null) |
| 13 | * @method Store|null findOneBy(array<string, mixed> $criteria, ?array<string, string> $orderBy = null) |
| 14 | * @method Store[] findAll() |
| 15 | * @method Store[] findBy(array<string, mixed> $criteria, ?array<string, string> $orderBy = null, $limit = null, $offset = null) |
| 16 | * |
| 17 | * @extends ServiceEntityRepository<Store> |
| 18 | */ |
| 19 | class StoreRepository extends ServiceEntityRepository |
| 20 | { |
| 21 | public function __construct(ManagerRegistry $registry) |
| 22 | { |
| 23 | parent::__construct($registry, Store::class); |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * @return Store[] |
| 28 | */ |
| 29 | public function getActive(): array |
| 30 | { |
| 31 | /** @var Store[] $result */ |
| 32 | $result = $this->createQueryBuilder('s') |
| 33 | ->where('s.user IS NOT NULL') |
| 34 | ->orderBy('s.id', 'ASC') |
| 35 | ->getQuery() |
| 36 | ->getResult(); |
| 37 | |
| 38 | return $result; |
| 39 | } |
| 40 | } |