Friday, February 26, 2010

Selecting only certain models in a findAll

Hi,

I've modeled my Cake application User centered.
- A User hasAndBelongsTo many Projects
- A User hasMany Posts
- A User belongsTo many Groups
etc etc

Now I'm trying to get a list of all the Projects for that User.
However doing a findAll() gives me way too much information (as I can
see in debug).
I don't want to fill my memory with al the user's posts when I'm
simply getting a list of projects.

How can I define which models to load when using a find() method?
eg. Only load User, Group and Project. But not Posts


thanks,
Bart

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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en

No comments: