Re: saving entries that are not related directly.

2009-04-21 Thread gaurav.v.sharma
But i won't be able to give additional information to afterSave() method in model. ($data.? that I want to insert.) If i am adding a comment to a topic, then I want to record it in activities table which I think will not be possible by afterSave() method because it will be in context to only

Re: saving entries that are not related directly.

2009-04-21 Thread brian
Your associations will be something like: Activity belongsTo User hasMany Comment From Comment model, one can do: $this-User-Activity-save(...) So, this could be done in afterSave() of a behavior for Comment. The behavior should work fine for any model that is associated with User. You

saving entries that are not related directly.

2009-04-20 Thread gaurav.v.sharma
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

Re: saving entries that are not related directly.

2009-04-20 Thread brian
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