Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Doctrine 2 DBAL Querybuilder and getting results

I'm using Doctrine DBAL and in the ORM docs it says, in order to execute a querybuilder query I first have to get a Query object using getQuery method. Unfortunately it looks like in DBAL there's no getQuery method to get the job done, so what's the procedure? get the SQL from getSQL method and execute it separately?

like image 293
Sahan H. Avatar asked Jul 03 '12 08:07

Sahan H.


1 Answers

If you want to retrieve an array you could do

$qb->execute()->fetchAll();
like image 68
AdrienBrault Avatar answered Nov 06 '22 01:11

AdrienBrault