Doctrine – Fetching Objects
Last night I was reading up on doctrine and came across a link to some basic, yet helpful info.
You should always use array hydration when you only need to data for access-only purposes, whereas you should use the record hydration when you need to change the fetched data.
Interesting. I’ve always tried to always use objects for reading data etc, but. but apparently doctrine has optimized the array population algorithm.
FYI, their call to
$q->execute(array(), Doctrine::HYDRATE_ARRAY);
Appears to be the same as:
$q->fetchArray();

Hey mike, greetings from Venezuela..
I’ve been working with hydration but i can’t seem to find the way that symfony retrieves arrays from fetchArray() function.
Don’t understand if they’re by index or associated arrays.
Have u work with that.?
Thanks.!