[DDC-2319] [GH-590] DQL Query: process ArrayCollection values to ease development Created: 25/Feb/13 Updated: 04/May/13 |
|
| Status: | Open |
| Project: | Doctrine 2 - ORM |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Security Level: | All |
| Type: | Improvement | Priority: | Major |
| Reporter: | Benjamin Eberlei | Assignee: | Benjamin Eberlei |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Description |
|
This issue is created automatically through a Github pull request on behalf of michaelperrin: Url: https://github.com/doctrine/doctrine2/pull/590 Message: 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: ```php But it doesn't work for collections: Where categories is an `ArrayCollection` object (retrieved from a many to one relation for instance). This doesn't work in the current version of Doctrine, and my PR solved that. So far, the only solution is to do the following: ```php foreach ($categories as $category) { $categoryIds[] = $category->getId(); }$queryBuilder = $this And this is pretty borring when you have to do it several times for several entities. Note that I didn't add any unit test for this feature. Can you explain me where I should add the test? Thanks! |