Code Duplication    Length = 11-11 lines in 2 locations

src/AppBundle/Entity/OrdersRepository.php 2 locations

@@ 21-31 (lines=11) @@
18
     * @param integer $count Nombre d'élément à afficher
19
     * @return array Query result
20
     */
21
    public function getLastOrder($count)
22
    {
23
        $query = $this->createQueryBuilder('o')
24
            ->where('o.status = 1')
25
            ->andWhere('o.delivdate < ' . date('d-m-Y'))
26
            ->orderBy('o.id', 'DESC')
27
            ->setMaxResults($count)
28
            ->getQuery();
29
30
        return $query->getResult();
31
    }
32
33
    /**
34
     * Renvoi les dernières commandes.
@@ 39-49 (lines=11) @@
36
     * @param integer $count Nombre d'élément à afficher
37
     * @return array Query result
38
     */
39
    public function getLastDelivery($count)
40
    {
41
        $query = $this->createQueryBuilder('o')
42
            ->where('o.status = 1')
43
            ->andWhere('o.delivdate >= ' . date('d-m-Y'))
44
            ->orderBy('o.id', 'DESC')
45
            ->setMaxResults($count)
46
            ->getQuery();
47
48
        return $query->getResult();
49
    }
50
}
51