Second non-trivial change to the event code. We now publish model

related events from within the model handling code.  The only
exception to this currently is item_created which is challenging
because we have to save the item using ORM_MPTT::add_to_parent()
before the object itself is fully set up.  When we get that down to
one call to save() we can publish that event from within the model
also.
This commit is contained in:
Bharat Mediratta
2009-07-16 12:29:16 -07:00
parent 43324fd12a
commit 0f766b149d
17 changed files with 57 additions and 28 deletions

View File

@@ -113,10 +113,6 @@ class Admin_Comments_Controller extends Admin_Controller {
if ($comment->loaded) {
$comment->state = $state;
$comment->save();
module::event("comment_updated", $comment);
if ($comment->original("state") == "published" || $comment->state == "published") {
module::event("item_related_update", $comment->item());
}
}
}