I need to fetch all records in database as Array using findAll()
in Doctrine, My Query is Something like this
$result = $this->getDoctrine()
The format in which the result of a DQL SELECT query is returned can be influenced by a so-called hydration mode
so you couldn't use it for findAll()
.you may try this below:
$em = $this->getDoctrine()->getManager();
$result = $em->createQuery('select m from CoreBundle:Categories m')
->getResult(\Doctrine\ORM\Query::HYDRATE_ARRAY);