doctrine: QueryBuilder vs createQuery?

  1. DQL is easier to read as it is very similar to SQL. If you don’t need to change the query depending on a set of parameters this is probably the best choice.

  2. Query Builder is an api to construct queries, so it’s easier if you need to build a query dynamically like iterating over a set of parameters or filters. You don’t need to do any string operations to build your query like join, split or whatever.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)