SettingsRepository   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 13
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 6
dl 0
loc 13
rs 10
c 0
b 0
f 0
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A getTheSingleRow() 0 6 1
1
<?php
2
3
namespace App\Repository;
4
5
use App\Entity\Settings;
6
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
7
use Doctrine\Persistence\ManagerRegistry;
8
9
/**
10
 * @method Settings|null find($id, $lockMode = null, $lockVersion = null)
11
 * @method Settings|null findOneBy(array $criteria, array $orderBy = null)
12
 * @method Settings[]    findAll()
13
 * @method Settings[]    findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
14
 */
15
class SettingsRepository extends ServiceEntityRepository
16
{
17
    public function __construct(ManagerRegistry $registry)
18
    {
19
        parent::__construct($registry, Settings::class);
20
    }
21
22
    public function getTheSingleRow(): ?Settings
23
    {
24
        return $this->createQueryBuilder('s')
25
            ->orderBy('s.id')
26
            ->getQuery()
27
            ->getOneOrNullResult();
28
    }
29
30
    // /**
31
    //  * @return Settings[] Returns an array of Settings objects
32
    //  */
33
    /*
34
    public function findByExampleField($value)
35
    {
36
        return $this->createQueryBuilder('s')
37
            ->andWhere('s.exampleField = :val')
38
            ->setParameter('val', $value)
39
            ->orderBy('s.id', 'ASC')
40
            ->setMaxResults(10)
41
            ->getQuery()
42
            ->getResult()
43
        ;
44
    }
45
    */
46
47
    /*
48
    public function findOneBySomeField($value): ?Settings
49
    {
50
        return $this->createQueryBuilder('s')
51
            ->andWhere('s.exampleField = :val')
52
            ->setParameter('val', $value)
53
            ->getQuery()
54
            ->getOneOrNullResult()
55
        ;
56
    }
57
    */
58
}
59