I have a Project
model and a Comment
model that are connected with has many relationship
( project -> comment ).
Im currently using CTimestampBehavior to keep the created and updated fields in sync
but i want the project model change update timestamp when a comment is added, changed or deleted. I got several of cases like this in my project and I would just like to know the best way to go about all of this.
Can I use AfterSave()
on each model and tell it to update its parent? That would trigger a chain when a comment is updated that would update all the way to the top. Should I do it this way or does Yii have support for this?