In the world of the blog example, I want to have an "approve" feature
added to the comments model. This will allow two pieces of
functionality

1) regular pages will only render "approved" comments for a post
2) special admin pages will render a table of all comments for a post
(approved or not) allowing the admin to see at a glance which posts
are approved or not.


Sounds simple enough.

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.

But how would I use this new method?

Can I easily instantiate a Comment object with the data that has
already been returned (without looking it up in the db again?)

Am I thinking along sensible lines?

For a more realistic example, imagine that the "is_approved" method,
in fact, had to look at a number of different pieces of data to
compute its result.

Mark

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to