mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-1309: Doctrine_Collection toArray() does not return results of table joins. #1640
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 @doctrinebot on GitHub (Aug 1, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user sharn.white:
e.g.
$doctrineCollection = Doctrine_Query::create()
->from('Table1 a')
->innerJoin('a.Table2 b ON a.id = b.id')
->execute();
$doctrineCollection->toArray() will return only the contents of Table1. However, $doctrineCollection->getFirst()->toArray() will return the results of Table1 + an additional key named 'Table2' which returns the join result from Table2.
It does not make sense for the collection hydration to differ to that of the objects in the collection.
@doctrinebot commented on GitHub (Aug 1, 2011):
Comment created by sharn.white:
If this is intended you can go ahead and trash this issue. Just doesn't seem right to me.
@doctrinebot commented on GitHub (Aug 1, 2011):
Comment created by sharn.white:
Nevermind. I should have been setting $deep to true.
@doctrinebot commented on GitHub (Aug 1, 2011):
Issue was closed with resolution "Fixed"