Maybe the easiest solution would be to create a Behavior that your
Comment, Item, etc. models implement. An afterSave() method would then
update the acitivities table.

On Mon, Apr 20, 2009 at 8:46 AM, gaurav.v.sharma
<gaurav.v.sha...@gmail.com> wrote:
>
> hi all,
>
> If we want to save all the related model data then we use the saveAll
> () method. But what should be done if I want to make an entry in that
> table which is not directly related to the related table.
>
> I have created a table named tbl_acitivites in which I am recording
> the actions of users like(added, deleted, commented) etc. etc. in this
> table I am updating the values of user_id and topic_id along with the
> action done.
>
> My problem is that whenever a user posts a comments related to a
> topic/ or reports the topic or adds an item to topiv then the
> tbl_activities should also be updated with required information. But
> it seems that I am stuck over here as to how do I update the table
> tbl_activities whenever an action (commented, reported, added) is
> performed because there is no direct relationship between the
> tbl_activities and tbl_comments, tbl_reported, tbl_items.
>
> I hope I am able to illustrate my problem clearly.
>
> Help me out please.
>
> thanks
> >
>

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

Reply via email to