Sahan H.
Sahan H.

Reputation: 472

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?

Upvotes: 5

Views: 9098

Answers (1)

AdrienBrault
AdrienBrault

Reputation: 7745

If you want to retrieve an array you could do

$qb->execute()->fetchAll();

Upvotes: 16

Related Questions