Yes, it's faster with a simple array hydrating... You don't instanciate your objects, just map their configuration.
Objects are useful for executing some business logic (sometimes, very complex). Array can be useful for templates, for example. Depends of your case, but don't be afraid of objects ;) make some time/memory measures in your use case, and select the best solution. Alexandre 2009/11/28 Adrien Mogenet <[email protected]> > Yes I knew that, but HYDRATE_ARRAY parameters is faster and acts > differently than when we HYDRATE_OBJECT ! > > That was my real question... ;-) > > On 27 nov, 23:40, Michael Boyd <[email protected]> wrote: > > The source of fetchArray() is: > > > > public function fetchArray($params = array()) > > { > > return $this->execute($params, Doctrine_Core::HYDRATE_ARRAY); > > } > > > > So they are exactly the same :) > > > > On Nov 27, 8:34 pm, Adrien Mogenet <[email protected]> wrote: > > > > > Hi all, > > > > > I'm a Propel user, but I'm switching to Doctrine... > > > > > I don't know if I should use execute() or fetchArray() to retrieve my > > > data. > > > > > execute() : I get an array of Object, and I like dealing with > > > Objects ! > > > > > fetchArray() : I read that it's better (less memory consuming ?) but I > > > don't really enjoy managing arrays (and arrays of arrays when I get > > > relationship). Moreover, when they're given to my view, it's > > > considered as sfOutputEscaperArrayDecorator so I have to perform - > > > > > >getRawValue(). > > > > > Is it really awful to call "execute()" method in Doctrine ? > > > > > -- > > > Adrien > > -- > > You received this message because you are subscribed to the Google Groups > "symfony users" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]<symfony-users%[email protected]> > . > For more options, visit this group at > http://groups.google.com/group/symfony-users?hl=en. > > > -- Alexandre Salomé -- [email protected] -- You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en.
