diff options
author | Bharat Mediratta <bharat@menalto.com> | 2009-01-10 11:25:33 +0000 |
---|---|---|
committer | Bharat Mediratta <bharat@menalto.com> | 2009-01-10 11:25:33 +0000 |
commit | 44bfc1c6a42838732669e59f686069491b583fe2 (patch) | |
tree | 65316f9b2cea5e060f2ade3f655a421eb1885d4b /modules/comment/models | |
parent | 74766e5b823faca35fa57467bd8e19d048c1a8fb (diff) |
Auto-delete 7-day old spam/deleted comments.
Diffstat (limited to 'modules/comment/models')
-rw-r--r-- | modules/comment/models/comment.php | 13 |
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(); + } } |