public function afterDelete() { (new History(['user_id' => $this->user_id, 'action' => History::ACTION_DELETE_TOPIC, 'target' => $this->id]))->save(false); TopicContent::deleteAll(['topic_id' => $this->id]); Node::updateCounterInfo('deleteTopic', $this->node_id); UserInfo::updateCounterInfo('deleteTopic', $this->user_id); $count = Comment::afterTopicDelete($this->id); Siteinfo::updateCountersInfo(['topics' => -1, 'comments' => -$count]); Favorite::afterTopicDelete($this->id); Notice::afterTopicDelete($this->id); return parent::afterDelete(); }