Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 7 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
GenreRepository | |
0.00% |
0 / 7 |
|
0.00% |
0 / 3 |
30 | |
0.00% |
0 / 1 |
__construct | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
add | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 | |||
remove | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
6 |
1 | <?php |
2 | |
3 | namespace App\Repository; |
4 | |
5 | use App\Entity\Genre; |
6 | use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository; |
7 | use Doctrine\Persistence\ManagerRegistry; |
8 | |
9 | /** |
10 | * @extends ServiceEntityRepository<Genre> |
11 | * |
12 | * @method Genre|null find($id, $lockMode = null, $lockVersion = null) |
13 | * @method Genre|null findOneBy(array $criteria, array $orderBy = null) |
14 | * @method Genre[] findAll() |
15 | * @method Genre[] findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null) |
16 | */ |
17 | class GenreRepository extends ServiceEntityRepository |
18 | { |
19 | public function __construct(ManagerRegistry $registry) |
20 | { |
21 | parent::__construct($registry, Genre::class); |
22 | } |
23 | |
24 | public function add(Genre $entity, bool $flush = false): void |
25 | { |
26 | $this->getEntityManager()->persist($entity); |
27 | |
28 | if ($flush) { |
29 | $this->getEntityManager()->flush(); |
30 | } |
31 | } |
32 | |
33 | public function remove(Genre $entity, bool $flush = false): void |
34 | { |
35 | $this->getEntityManager()->remove($entity); |
36 | |
37 | if ($flush) { |
38 | $this->getEntityManager()->flush(); |
39 | } |
40 | } |
41 | |
42 | // /** |
43 | // * @return Genre[] Returns an array of Genre objects |
44 | // */ |
45 | // public function findByExampleField($value): array |
46 | // { |
47 | // return $this->createQueryBuilder('g') |
48 | // ->andWhere('g.exampleField = :val') |
49 | // ->setParameter('val', $value) |
50 | // ->orderBy('g.id', 'ASC') |
51 | // ->setMaxResults(10) |
52 | // ->getQuery() |
53 | // ->getResult() |
54 | // ; |
55 | // } |
56 | |
57 | // public function findOneBySomeField($value): ?Genre |
58 | // { |
59 | // return $this->createQueryBuilder('g') |
60 | // ->andWhere('g.exampleField = :val') |
61 | // ->setParameter('val', $value) |
62 | // ->getQuery() |
63 | // ->getOneOrNullResult() |
64 | // ; |
65 | // } |
66 | } |