'afterValidate', ]; } /** * @param Event $event */ public function afterValidate($event) { /** * @var CommentModel $owner */ $owner = $this->owner; if(!empty($owner->artbox_comment_pid)) { /** * @var CommentModel $parent */ $parent = CommentModel::find()->where(['artbox_comment_id' => $owner->artbox_comment_pid])->one(); if(!empty($parent->artbox_comment_pid)) { $owner->related_id = $owner->artbox_comment_pid; $owner->artbox_comment_pid = $parent->artbox_comment_pid; } } } }