/** * @return \yii\db\ActiveQuery */ public function getDeck() { return $this->hasOne(Deck::className(), ['id' => 'deck_id']); }
public function getDecks() { return $this->hasMany(Deck::className(), ['id' => 'deck_id'])->viaTable('deck_has_cards', ['card_id' => 'id']); }