get("batch_id"); if (!batch::in_progress("add") { notification::send_item_add($item); } else { } } static function item_before_delete($item) { notification::send_item_deleted($item); if (notification::is_watching($item)) { notification::remove_watch($item); } } static function comment_created($comment) { if ($comment->state == "published") { notification::send_comment_published($comment); } } static function comment_updated($old, $new) { if ($new->state == "published" && $old->state != "published") { notification::send_comment_published($new); } } static function user_before_delete($user) { ORM::factory("subscription") ->where("user_id", $user->id) ->delete_all(); } }