ProblemRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 4
c 1
b 0
f 0
dl 0
loc 11
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A clearAllProblems() 0 4 1
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