public function getParent() { if ($this->parent_id) { return $this->hasOne(Comment::className(), ['id' => 'parent_id']); } return null; }
/** * @return \yii\db\ActiveQuery */ public function getComments() { return $this->hasMany(Comment::className(), ['discussionID' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getComments() { return $this->hasMany(Comment::className(), ['model_class' => 'id']); }