From: gonzo <fis...@gmail.com>
Date: Sat, 22 Sep 2012 05:44:37 -0700 (PDT)
Local: Sat, Sep 22 2012 8:44 am
Subject: Difference between results of getArrayResult() and execute()
I have a DQL that is executed multiple times with different parameters. On the second (and subsequent) run, there is a difference between the I have checked that the caching part of AbstractQuery:execute is not Can anyone explain? The code I've used to demonstrate the issue is: > foreach($q->getArrayResult() as $group) { That displays e.g. the following: > foreach($group['properties'] as $property) { > foreach($property['values'] as $value) { > echo $value['id'] . ' '; > } > } > } > echo '<br>'; >> foreach($q->execute() as $group) { > foreach($group->getProperties() as $property) { > foreach($property->getValues() as $value) { > echo $value->getId() . ' '; > } > } > } > echo '<br><br>'; > 51 52 137 55 As you see the second line of each segment remains the same, whereas the > 51 52 137 55 >> 73 74 141 177 77 > 51 52 137 55 >> 78 79 142 178 82 > 51 52 137 55 >> 83 84 143 179 87 > 51 52 137 55 first line (array hydration) is correct. Thanks in advance :) You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||