mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
How do you query? #5859
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @manishbathla on GitHub (Jan 27, 2018).
Originally assigned to: @Ocramius on GitHub.
have never used doctrine or any other DAL for that matter but I need to switch. I need to know whether I can query something like this in doctrine
?
@Ocramius commented on GitHub (Jan 27, 2018):
Please refer to http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/reference/dql-doctrine-query-language.html for documentation of how the doctrine query language works.
What you wrote there is SQL, which can be run on Doctrine DBAL, not in Doctrine ORM.
In Doctrine ORM, the query above would be translated (in DQL) to:
If you wanted to select all records where
Description#languageIdis1, you'd do that after selecting yourCategoryinstances with the query above. See also https://groups.google.com/d/msg/doctrine-user/_1_Nh89--2A/D5CwzSwqDgAJ about why filtering of the association is not really possible without breaking the in-memory data structure.