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