Code Duplication    Length = 13-15 lines in 2 locations

src/AppBundle/Controller/DeliveriesController.php 1 location

@@ 40-52 (lines=13) @@
37
     * @Method("GET")
38
     * @Template()
39
     */
40
    public function indexAction(Request $request)
41
    {
42
        $etm = $this->getDoctrine()->getManager();
43
        $item = $this->container->getParameter('knp_paginator.page_range');
44
        $qbd = $etm->getRepository('AppBundle:Orders')->createQueryBuilder('o');
45
        $qbd->where('o.delivdate >= ' . date('Y-m-d'));
46
        $qbd->andWhere('o.status = 1');
47
        
48
        $paginator = $this->get('knp_paginator')->paginate($qbd, $request->query->get('page', 1), $item);
49
        return array(
50
            'paginator' => $paginator,
51
        );
52
    }
53
54
    /**
55
     * Finds and displays a Orders entity.

src/AppBundle/Controller/OrdersController.php 1 location

@@ 43-57 (lines=15) @@
40
     * @Method("GET")
41
     * @Template()
42
     */
43
    public function indexAction(Request $request)
44
    {
45
        $em = $this->getDoctrine()->getManager();
46
        $item = $this->container->getParameter('knp_paginator.page_range');
47
        $qb = $em->getRepository('AppBundle:Orders')->createQueryBuilder('o');
48
        $qb->where('o.orderdate < ' . date('Y-m-d'));
49
        
50
        $createForm = $this->createCreateForm('orders_create');
51
52
        $paginator = $this->get('knp_paginator')->paginate($qb, $request->query->get('page', 1), $item);
53
        return array(
54
            'create_form' => $createForm->createView(),
55
            'paginator' => $paginator,
56
        );
57
    }
58
59
    /**
60
     * Finds and displays a Orders entity.