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