示例#1
0
 /**
  * @PreDelete
  */
 public function deleted()
 {
     if ($this->comments->count() > 0) {
         foreach ($this->comments as $comment) {
             \FA\Legacy\Notifications::purge('journal_comment', $comment->id, $this->user_id);
         }
     }
     User::decrementCounter('journals', $this->user_id);
     \FA\Legacy\Notifications::purge('journal', $this->id);
 }
示例#2
0
 /**
  * @PreDelete
  */
 public function deleting()
 {
     // Delete files
     $full_path = $this->getFullPath();
     if (!empty($full_path)) {
         @unlink($full_path);
     }
     $small_path = $this->getSmallPath();
     if (!empty($small_path)) {
         @unlink($small_path);
     }
     $thumb_path = $this->getThumbnailPath();
     if (!empty($thumb_path)) {
         @unlink($thumb_path);
     }
     if ($this->comments->count() > 0) {
         foreach ($this->comments as $comment) {
             \FA\Legacy\Notifications::purge('upload_comment', $comment->id, $this->user_id);
         }
     }
     User::decrementCounter('uploads', $this->user_id);
     \FA\Legacy\Notifications::purge('upload', $this->id);
 }
示例#3
0
 /**
  * @PreDelete
  */
 public function deleted()
 {
     User::decrementCounter('comments_sent', $this->user_id);
     User::decrementCounter('comments_received', $this->upload->user_id);
     \FA\Legacy\Notifications::purge('upload_comment', $this->id, $this->upload->user_id);
 }
示例#4
0
 /**
  * @PreDelete
  */
 public function deleted()
 {
     User::decrementCounter('favorites', $this->user_id);
     \FA\Legacy\Notifications::purge('favorite', $this->id, $this->user_id);
 }