Hi,

Thank you for reply.

I already limit my results but this is not the issue I raise. :)
Basically, I want to do it 'old school', something like:
$resource = $this->Model->getResource($query_conditions);
while ($row = $this->Model->fetchRow($resource)) {
// do something
}

So far I didn't find anything in docs, looks like I'll have to dig in the
source code for the answer. Hope that there is a way to do this.

Cheers,
Adrian

On Fri, Nov 5, 2010 at 6:18 PM, cricket <[email protected]> wrote:

> On Fri, Nov 5, 2010 at 4:19 AM, Adrian Arnautu <[email protected]>
> wrote:
> > Hello to everyone,
> > Is there a way to get a resource and then fetch a row at a time from it
> > instead of getting the whole rows in one structure?
> > For a small dataset it's relatively fine, but when this dataset is
> growing
> > (for example, you want to generate a CSV having ~ 5-6k rows or maybe
> more)
> > it looks overkilling in terms of memory requirements.
> > I know that the possible answer is somewhere in the source code, I want
> to
> > know if any of you used this approach.
>
> You could set 'limit' in your find() and loop until it returns no more
> results. Don't forget to set the offset, of course.
>
> Or, I suppose you could use paginate() as well, changing the 'page'
> param each iteration.
>
> Check out the new CakePHP Questions site http://cakeqs.org and help others
> with their CakePHP related questions.
>
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]<cake-php%[email protected]>For
>  more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" 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/cake-php?hl=en

Reply via email to