On Aug 8, 2006, at 10:21 AM, Mark Quinn wrote:

> The post controller does a recursive find to get a post and its
> comments. However this returns a big fat array of all the required
> data and does not use my yummy objects. I can read a specific database
> field to find if something is approved or not, but this is not very
> OO. I would like to add an "is_approved" method to my Comment object.

Wouldn't this method just read the database field anyway?

You might try associating your comments to your posts in two ways -  
one way that only grabs approved comments, and another that only  
grabs not-yet-approved comments. You can do this using the  
'conditions' key of the hasMany array.

This is ORM, so that's pretty object-friendly. :)

-- John



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---

Reply via email to