/** * Updates the comment_count after finding new data */ protected function afterFind() { parent::afterFind(); $this->comment_count = $this->getCommentCount(); $this->like_count = $this->getLikeCount(); }