summaryrefslogtreecommitdiff
path: root/modules/comment/models
diff options
context:
space:
mode:
authorBharat Mediratta <bharat@menalto.com>2009-01-10 11:25:33 +0000
committerBharat Mediratta <bharat@menalto.com>2009-01-10 11:25:33 +0000
commit44bfc1c6a42838732669e59f686069491b583fe2 (patch)
tree65316f9b2cea5e060f2ade3f655a421eb1885d4b /modules/comment/models
parent74766e5b823faca35fa57467bd8e19d048c1a8fb (diff)
Auto-delete 7-day old spam/deleted comments.
Diffstat (limited to 'modules/comment/models')
-rw-r--r--modules/comment/models/comment.php13
1 files changed, 13 insertions, 0 deletions
diff --git a/modules/comment/models/comment.php b/modules/comment/models/comment.php
index c83b2721..989597a8 100644
--- a/modules/comment/models/comment.php
+++ b/modules/comment/models/comment.php
@@ -52,4 +52,17 @@ class Comment_Model extends ORM {
return $author->url;
}
}
+
+ /**
+ * @see ORM::save()
+ */
+ public function save() {
+ if (!empty($this->changed)) {
+ $this->updated = time();
+ if (!$this->loaded) {
+ $this->created = $this->updated;
+ }
+ }
+ return parent::save();
+ }
}