Code Duplication    Length = 9-15 lines in 4 locations

src/AppBundle/Controller/ArticleController.php 1 location

@@ 45-56 (lines=12) @@
42
     * @param \Symfony\Component\HttpFoundation\Request $request Paginate request
43
     * @return array
44
     */
45
    public function indexAction(Request $request)
46
    {
47
        $item = $this->container->getParameter('knp_paginator.page_range');
48
        $etm = $this->getDoctrine()->getManager();
49
        $qbd = $etm->getRepository('AppBundle:Article')->getArticles();
50
        $this->addQueryBuilderSort($qbd, 'article');
51
        $paginator = $this->get('knp_paginator')->paginate($qbd, $request->query->get('page', 1), $item);
52
        
53
        return array(
54
            'paginator' => $paginator,
55
        );
56
    }
57
58
    /**
59
     * Finds and displays a Article entity.

src/AppBundle/Controller/InventoryController.php 1 location

@@ 49-63 (lines=15) @@
46
     * @param \Symfony\Component\HttpFoundation\Request $request Paginate request
47
     * @return array
48
     */
49
    public function indexAction(Request $request)
50
    {
51
        $item = $this->container->getParameter('knp_paginator.page_range');
52
        $etm = $this->getDoctrine()->getManager();
53
        $qbd = $etm->getRepository('AppBundle:Inventory')->getInventory();
54
        
55
        $createForm = $this->createCreateForm('inventory_create');
56
57
        $paginator = $this->get('knp_paginator')->paginate($qbd, $request->query->get('page', 1), $item);
58
59
        return array(
60
            'paginator' => $paginator,
61
            'create_form' => $createForm->createView(),
62
        );
63
    }
64
65
    /**
66
     * Finds and displays a Inventory entity.

src/AppBundle/Controller/SupplierController.php 1 location

@@ 43-52 (lines=10) @@
40
     * @param \Symfony\Component\HttpFoundation\Request $request Paginate|Sort request
41
     * @return array
42
     */
43
    public function indexAction(Request $request)
44
    {
45
        $item = $this->container->getParameter('knp_paginator.page_range');
46
        $etm = $this->getDoctrine()->getManager();
47
        $qbd = $etm->getRepository('AppBundle:Supplier')->getSuppliers();
48
        $this->addQueryBuilderSort($qbd, 'supplier');
49
        $paginator = $this->get('knp_paginator')->paginate($qbd, $request->query->get('page', 1), $item);
50
        
51
        return array('paginator' => $paginator,);
52
    }
53
54
    /**
55
     * Finds and displays a Supplier entity.

src/AppBundle/Controller/UserController.php 1 location

@@ 45-53 (lines=9) @@
42
     * @param \Symfony\Component\HttpFoundation\Request $request Paginate|Sort request
43
     * @return array
44
     */
45
    public function indexAction(Request $request)
46
    {
47
        $etm = $this->getDoctrine()->getManager();
48
        $qbd = $etm->getRepository('AppBundle:User')->getUsers();
49
        $this->addQueryBuilderSort($qbd, 'user');
50
        $paginator = $this->get('knp_paginator')->paginate($qbd, $request->query->get('page', 1), 5);
51
        
52
        return array('paginator' => $paginator,);
53
    }
54
55
    /**
56
     * Finds and displays a User entity.