Skip to content

Loading…

DDC-1309: Doctrine_Collection toArray() does not return results of table joins. #1922

Closed
doctrinebot opened this Issue · 3 comments

2 participants

@doctrinebot

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

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

Comment created by sharn.white:

Nevermind. I should have been setting $deep to true.

@doctrinebot

Issue was closed with resolution "Fixed"

@beberlei beberlei was assigned by doctrinebot
@doctrinebot doctrinebot added this to the 2.1 milestone
@doctrinebot doctrinebot closed this
@doctrinebot doctrinebot added the Bug label
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.