ProblemRepository::__construct()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 1
dl 0
loc 3
rs 10
1
<?php
2
3
namespace App\Repository;
4
5
use App\Entity\Problem;
6
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
7
use Doctrine\Persistence\ManagerRegistry;
8
9
/**
10
 * @method Problem|null find($id, $lockMode = null, $lockVersion = null)
11
 * @method Problem|null findOneBy(array $criteria, array $orderBy = null)
12
 * @method Problem[]    findAll()
13
 * @method Problem[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
14
 */
15
class ProblemRepository extends ServiceEntityRepository
16
{
17
    public function __construct(ManagerRegistry $registry)
18
    {
19
        parent::__construct($registry, Problem::class);
20
    }
21
22
    public function clearAllProblems(): void
23
    {
24
        $qb = $this->getEntityManager()->createQueryBuilder();
25
        $qb->delete('App\Entity\Problem', 'p')->getQuery()->execute();
26
    }
27
28
    // /**
29
    //  * @return Problem[] Returns an array of Problem objects
30
    //  */
31
    /*
32
    public function findByExampleField($value)
33
    {
34
        return $this->createQueryBuilder('p')
35
            ->andWhere('p.exampleField = :val')
36
            ->setParameter('val', $value)
37
            ->orderBy('p.id', 'ASC')
38
            ->setMaxResults(10)
39
            ->getQuery()
40
            ->getResult()
41
        ;
42
    }
43
    */
44
45
    /*
46
    public function findOneBySomeField($value): ?Problem
47
    {
48
        return $this->createQueryBuilder('p')
49
            ->andWhere('p.exampleField = :val')
50
            ->setParameter('val', $value)
51
            ->getQuery()
52
            ->getOneOrNullResult()
53
        ;
54
    }
55
    */
56
}
57