Esempio n. 1
0
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         //delete: Messages(to/from), Ban History, UpVotes, LogTopic
         YBoardMessage::deleteAll(['or', 'sendfrom' => $this->id, 'sendto' => $this->id]);
         // Post(Polls and Votes)
         YBoardVote::deleteAll(['user_id' => $this->id]);
         YBoardUpvoted::deleteAll(['member_id' => $this->id]);
         YBoardPoll::deleteAll(['user_id' => $this->id]);
         YBoardPost::deleteAll(['user_id' => $this->id]);
         //log topic
         YBoardLogTopic::deleteAll(['member_id' => $this->id]);
         //ban
         YBoardBan::deleteAll(['user_id' => $this->id]);
         return true;
     } else {
         return false;
     }
 }
Esempio n. 2
0
 public function beforeDelete()
 {
     if (parent::beforeDelete()) {
         //delete all upvotes and polls
         YBoardUpvoted::deleteAll(['post_id' => $this->id]);
         YBoardPoll::deleteAll(['post_id' => $this->id]);
         return true;
     } else {
         return false;
     }
 }