/** * [getSuperNotes description] * @return ActiveRecord */ public function getSuperNotes() { // return $this->hasMany(SuperNoteProductRel::className(),['product_id'=>'id'])->viaTable(SuperNotes::className(),['id'=>'id']); // return $this->hasMany(SuperNoteProductRel::className(),['product_id'=>'id']); return $this->hasMany(SuperNotes::className(), ['id' => 'super_note_id'])->via('superNoteProductRels'); }
/** * @return \yii\db\ActiveQuery */ public function getSuperNote() { return $this->hasOne(SuperNotes::className(), ['id' => 'super_note_id']); }