Пример #1
0
 public function getCardsCount()
 {
     return count(DeckHasCards::find()->where(['=', 'deck_id', $this->id])->all());
 }
Пример #2
0
 /**
  * @return \yii\db\ActiveQuery
  */
 public function getDeckHasCards()
 {
     return $this->hasMany(DeckHasCards::className(), ['card_id' => 'id']);
 }