Im developing a site and owuld like to maintain a list of updates that have happened since a users last visit e.g.
Whats been happening:
28/11/11 14:00 - New member joined: Joe Boggs
28/11/11 14:00 - Fixture added
28/11/11 14:00 - Result updated
Table would contain something like UpdateDateTime, URL, Message.
Whats the best way to go about updating this table following model inserts/updates? I was thinking about raising an event (onUpdate) in the controller (which would populate the url, message etc in the event) and have a static function handle the updation of the latestUpdates table? Does this sound feasible? Had also though of using the afterSave handler but creating the URL from within the model doesnt seem right. Any recommendations if theres a better way to do this in Yii?
Firstly thanks for replying. I had thought of using a behaviour but as i want to store a message and link for each save type e.g. New User added: <Username>, New fixture added: <Team> vs <Team> etc the behaviour wont know what type of update has occured and what fields (e.g. <Username>) it can obtain as well as what url to use? Or am i missing something?