true, 'targetClass' => Skill::className(), 'targetAttribute' => ['skill_id' => 'id']], [['card_id'], 'exist', 'skipOnError' => true, 'targetClass' => UserCard::className(), 'targetAttribute' => ['card_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'card_id' => 'Card ID', 'skill_id' => 'Skill ID', ]; } /** * @return \yii\db\ActiveQuery */ public function getSkill() { return $this->hasOne(Skill::className(), ['id' => 'skill_id']); } /** * @return \yii\db\ActiveQuery */ public function getCard() { return $this->hasOne(UserCard::className(), ['id' => 'card_id']); } }