public function beforeDelete() { if (parent::beforeDelete()) { YBoardVote::deleteAll(['choice_id' => $this->id]); return true; } else { return false; } }
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; } }