Code Duplication    Length = 13-15 lines in 2 locations

src/AppBundle/Controller/DeliveriesController.php 1 location

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

src/AppBundle/Controller/OrdersController.php 1 location

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