Questions tagged [doctrine-query]

Doctrine Query Language (DQL) is one of the Doctrine 2 ORM key features, it is the option to write database queries in a proprietary object oriented SQL dialect.

Doctrine Query Language (DQL) is one of the Doctrine 2 ORM key features, it is the option to write database queries in a proprietary object oriented SQL dialect. Inspired by Hibernates HQL, this provides developers with a powerful alternative to SQL that maintains flexibility without requiring unnecessary code duplication.

More about Doctrine ORM you could fine on the project site, here.

370 questions
-1
votes
2 answers

Doctrine - Order by utf-8 collation

Topic: ordering in doctrine. I want to order car brands and the problem appears when I want to order brands that start with characters such as Š, Đ, Ć, Č or Ž. For example, when I use doctrines orderBy function I get this for my…
-1
votes
1 answer

Stuck on a DQL left join query

I have two tables: Users <----> Questions They use a ManyToMany relation table to keep track of which user answered which question. Users <----> UsersQuestions <----> Questions Now I need to write a query which fetches all…
Rijstkoek
  • 241
  • 1
  • 2
  • 12
-1
votes
1 answer

Why Doctrine MongoDB ODM findBy and execute returns different classes?

sBased on Doctrine documentation $qb->getQuery()->execute(); will return a cursor for you to iterator over the results but $qb->find($criteria); returns the actual found Documents. I am using symfony2 MongoDBbundle and I would like to avoid…
pmoubed
  • 3,842
  • 10
  • 37
  • 60
-1
votes
2 answers

Symfony2.3 Doctrine Query Builder complex query

I am looking for the equivalent of this SQL SELECT statement in Doctrine Query Builder: SELECT p.* FROM position p, fonction f WHERE ( (p.id = f.position_id) AND (p.type ='MONO_MEMBRE') AND (f.date_fin IS NOT NULL) ) OR ( p.type='MULTI_MEMBRE'…
zgkais
  • 33
  • 5
-1
votes
1 answer

OneToMany relationship not populating children

I make the assumption when an entity has a OneToMany relationship with another, the children entities will be populated when querying the parent entity. $account = $this->Repository()->findById($organization, $id,…
mikeluby
  • 171
  • 1
  • 2
  • 7
-1
votes
1 answer

Override execute() function to use a predefined query

I have a symfony application with several tables (or objects) that are associated with a place. Sometimes, throughout the app, I have to make some complex filtering (queries) to those objects based on the current place the user is navigating. My…
pjamfaro
  • 23
  • 1
  • 6
-2
votes
1 answer

How to apply equality criteria in doctrine findBy condition?

Is it possible to apply criteria >= condition in Doctrine findBy. I have a query like this: select * from source where id >= 10 I am looking to apply in following way which will return with reference to Object…
user1687891
  • 794
  • 2
  • 14
  • 30
-2
votes
1 answer

Advanced SQL query in symfony2 doctrine

I am working on a project using Symfony2.8 and MySQL. I have 4 tables in my database that are users, quotes, articles, articlesquotes. user table …
Mostafa
  • 63
  • 2
  • 11
-3
votes
1 answer

'Error: Class 'search_result' is not defined' in custom query

I'm trying to get the result of the query from the database. $em2 = $this->getDoctrine()->getManager(); $qb=$em2->createQuery('select count(DISTINCT hotel_id) FROM search_result where…
Dmitry
  • 27
  • 6
-3
votes
1 answer

Convert Sql to Dql

I need to convert this sql line to Dql. SELECT * FROM agent JOIN maison ON agent.id = maison.id_agent WHERE maison.id = 2
Nacer Naciri
  • 67
  • 2
  • 8
1 2 3
24
25
user_id