diff options
author | Evan Prodromou <evan@controlyourself.ca> | 2009-07-16 00:52:23 -0400 |
---|---|---|
committer | Evan Prodromou <evan@controlyourself.ca> | 2009-07-16 00:52:23 -0400 |
commit | b6f816c785d9123e36a84f879b65c073d2023e04 (patch) | |
tree | 1ab7ebdc883d33b3c7077eaae02eeceedb952861 | |
parent | f3af264c03745d42487672d462b6d94d2b537af3 (diff) |
save an archive of deleted notices
-rw-r--r-- | classes/Notice.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/classes/Notice.php b/classes/Notice.php index 0359c310d..c6ad7d6c4 100644 --- a/classes/Notice.php +++ b/classes/Notice.php @@ -74,7 +74,21 @@ class Notice extends Memcached_DataObject $this->blowFavesCache(true); $this->blowSubsCache(true); + // For auditing purposes, save a record that the notice + // was deleted. + + $deleted = new Deleted_notice(); + + $deleted->id = $this->id; + $deleted->profile_id = $this->profile_id; + $deleted->uri = $this->uri; + $deleted->created = $this->created; + $deleted->deleted = common_sql_now(); + $this->query('BEGIN'); + + $deleted->insert(); + //Null any notices that are replies to this notice $this->query(sprintf("UPDATE notice set reply_to = null WHERE reply_to = %d", $this->id)); $related = array('Reply', |