Accepted answer

According to this EntityRepository class, findAll don't take multiple arguments.

The code below should do what you want

$result = $this->getDoctrine()


Use getScalarResult() to get an array result with objects truncated to strings.


You can also use the getArrayResult() function instead of getResult(). It returns an array of data instead:

$query = $em->createQuery("SELECT test FROM namespaceTestBundle:Test test");
$tests = $query->getArrayResult();

Related Query

More Query from same tag