/** * @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); }
/** * @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); }
public function setIsRead($new_value) { if ((bool) $new_value != (bool) $this->is_read) { if ($new_value) { Notifications::purge('note', $this->id, $this->recipient_id); } else { Notifications::dispatch('note', $this->id, $this->recipient_id); } } $this->is_read = (bool) $new_value; }
/** * @PreDelete */ public function deleted() { \FA\Legacy\Notifications::purge('shout', $this->id, $this->recipient->id); }
/** * @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); }
/** * @PreDelete */ public function deleted() { \FA\Legacy\Notifications::purge('watch', $this->id, $this->target_id); }
/** * @PreDelete */ public function deleted() { \FA\Legacy\Notifications::purge('ticket', $this->id, $this->ticket->user_id); }
/** * @PreDelete */ public function deleted() { \FA\Legacy\Notifications::purge('journal_comment', $this->id, $this->journal->user_id); }
/** * @PreDelete */ public function deleted() { User::decrementCounter('favorites', $this->user_id); \FA\Legacy\Notifications::purge('favorite', $this->id, $this->user_id); }