I need to fetch all records in database as Array using findAll()
in Doctrine, My Query is Something like this
$result = $this->getDoctrine()
The findAll()
method does not have any parameters. You can, for example, use the repository's createQueryBuilder()
method to achieve what you want to do:
use Doctrine\ORM\Query;
// ...
$query = $this->getDoctrine()
->getRepository('CoreBundle:Categories')
->createQueryBuilder('c')
->getQuery();
$result = $query->getResult(Query::HYDRATE_ARRAY);