true, 'targetClass' => Achievement::className(), 'targetAttribute' => ['achievement_id' => 'id']], [['user_card_id'], 'exist', 'skipOnError' => true, 'targetClass' => UserCard::className(), 'targetAttribute' => ['user_card_id' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'achievement_id' => 'Achievement ID', 'user_card_id' => 'User Card ID', ]; } /** * @return \yii\db\ActiveQuery */ public function getAchievement() { return $this->hasOne(Achievement::className(), ['id' => 'achievement_id']); } /** * @return \yii\db\ActiveQuery */ public function getUserCard() { return $this->hasOne(UserCard::className(), ['id' => 'user_card_id']); } }