Ejemplo n.º 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);
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 3
0
 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;
 }
Ejemplo n.º 4
0
 /**
  * @PreDelete
  */
 public function deleted()
 {
     \FA\Legacy\Notifications::purge('shout', $this->id, $this->recipient->id);
 }
Ejemplo n.º 5
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);
 }
Ejemplo n.º 6
0
 /**
  * @PreDelete
  */
 public function deleted()
 {
     \FA\Legacy\Notifications::purge('watch', $this->id, $this->target_id);
 }
Ejemplo n.º 7
0
 /**
  * @PreDelete
  */
 public function deleted()
 {
     \FA\Legacy\Notifications::purge('ticket', $this->id, $this->ticket->user_id);
 }
Ejemplo n.º 8
0
 /**
  * @PreDelete
  */
 public function deleted()
 {
     \FA\Legacy\Notifications::purge('journal_comment', $this->id, $this->journal->user_id);
 }
Ejemplo n.º 9
0
 /**
  * @PreDelete
  */
 public function deleted()
 {
     User::decrementCounter('favorites', $this->user_id);
     \FA\Legacy\Notifications::purge('favorite', $this->id, $this->user_id);
 }