Example #1
0
 /**
  * Marks a file for deletion
  *
  * @param   integer  $post_id  The ID of the post which is associated with the attachment
  * @return  void
  */
 public function markForDelete($post_id)
 {
     // Check if they are logged in
     if (User::isGuest()) {
         return;
     }
     // Load attachment object
     $row = new Tables\Attachment($this->database);
     $row->loadByPost($post_id);
     //mark for deletion
     $row->set('status', 2);
     if (!$row->store()) {
         $this->setError($row->getError());
     }
 }