/** * @return \yii\db\ActiveQuery */ public function getComments() { return $this->hasMany(Comment::className(), ['post_id' => 'id']); }
/** * @return \yii\db\ActiveQuery */ public function getComment() { return $this->hasOne(Comment::className(), ['id' => 'id']); }