How can I sort by name? : In my Symfony Controller, in listarAction, I list all articles of the database, but I'd like to sort them by the name of article. I have this:



    public function listarAction(Request $request) { {
            $em = $this->getDoctrine()->getManager();
            $articulos = $em->getRepository("BDBundle:Articulos")->findAll();


            $paginator = $this->get('knp_paginator');
            $pagination = $paginator->paginate(
                    $articulos, $request->query->getInt('page', 1), 5);

            return $this->render('AppBundle:Default:productos_listar.html.twig', array(
                        'pagination' => $pagination
                           
            ));
        }
    }


How would it be the correct form? Thanks.

 