Completed
Push — Recipes ( c1a0bd...9ec83f )
by Laurent
24:17
created

SettingsRepository::findFirst()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 9

Duplication

Lines 9
Ratio 100 %

Importance

Changes 0
Metric Value
dl 9
loc 9
rs 9.9666
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 * Entité Settings.
5
 *
6
 * PHP Version 5
7
 *
8
 * @author    Quétier Laurent <[email protected]>
9
 * @copyright 2014 Dev-Int GLSR
10
 * @license   http://opensource.org/licenses/gpl-license.php GNU Public License
11
 *
12
 * @version GIT: <git_id>
13
 *
14
 * @link https://github.com/Dev-Int/glsr
15
 */
16
namespace AppBundle\Repository\Settings;
17
18
use Doctrine\ORM\EntityRepository;
19
20
/**
21
 * SettingsRepository Entité Settings.
22
 *
23
 * @category Entity
24
 */
25 View Code Duplication
class SettingsRepository extends EntityRepository
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
26
{
27
    /**
28
     * Affiche toutes les configurations.
29
     *
30
     * @return QueryBuilder Requête DQL
31
     */
32
    public function getAllItems()
33
    {
34
        $query = $this->createQueryBuilder('s')
35
            ->getQuery()->getResult();
36
37
        return $query;
38
    }
39
40
    /**
41
     * Affiche les configurations actives.
42
     *
43
     * @return QueryBuilder Requête DQL
44
     */
45
    public function getItems()
46
    {
47
        $query = $this->getAllItems();
48
49
        return $query;
50
    }
51
52
    /**
53
     * Affiche le premier enregistrement.
54
     *
55
     * @return QueryBuilder Requête DQL
56
     */
57
    public function findFirst()
58
    {
59
        $query = $this->createQueryBuilder('s')
60
            ->setMaxResults(1)
61
            ->orderBy('s.id', 'ASC')
62
            ->getQuery()->getSingleResult();
63
64
            return $query;
65
    }
66
}
67