mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
[PR #590] [MERGED] DQL Query: process ArrayCollection values to ease development #8412
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?
📋 Pull Request Information
Original PR: https://github.com/doctrine/orm/pull/590
Author: @michaelperrin
Created: 2/25/2013
Status: ✅ Merged
Merged: 12/17/2013
Merged by: @guilhermeblanco
Base:
master← Head:feature/process-collection-value📝 Commits (1)
1032a16Simpler way to handle Collection parameters in DQL queries (refs #DDC-2319)📊 Changes
2 files changed (+55 additions, -1 deletions)
View changed files
📝
lib/Doctrine/ORM/AbstractQuery.php(+6 -1)📝
tests/Doctrine/Tests/ORM/Functional/QueryTest.php(+49 -0)📄 Description
I added some code to ease "where in" parameter binding.
As you know, when a where condition is added, the object itself can be passed as a parameter and it's id is automatically retrieved:
Where
$categoryis an object.But it doesn't work for collections:
Where categories is an
ArrayCollectionobject (retrieved from a many to one relation for instance).This doesn't work in the current version of Doctrine, and my PR solves that.
Note that I didn't add any unit test for this feature. Can you explain me where I should add the test?This enhancement is now unit-tested in this same PR.
So far, the only solution was to do the following, which is pretty borring:
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.