63 lines
1.7 KiB
PHP
63 lines
1.7 KiB
PHP
<?php
|
|
include_once 'userEmail.php';
|
|
include_once 'genderEnum.php';
|
|
|
|
class User{
|
|
private $firstname;
|
|
private $lastname;
|
|
private $birthdate;
|
|
private $userEmail;
|
|
private $password;
|
|
|
|
public function __construct($firstname, $lastname, $birthdate, Gender $gender, $username, $password) {
|
|
$this->firstname = $firstname;
|
|
$this->lastname = $lastname;
|
|
$this->birthdate = $birthdate;
|
|
$this->gender = $gender;
|
|
$this->password = $password;
|
|
$this->userEmail = new userEmail($username, $password);
|
|
}
|
|
|
|
|
|
public function getFirstname() {
|
|
return $this->firstname;
|
|
}
|
|
|
|
public function setFirstname($firstname) {
|
|
$this->firstname = $firstname;
|
|
}
|
|
|
|
public function getLastname() {
|
|
return $this->lastname;
|
|
}
|
|
|
|
public function setLastname($lastname) {
|
|
$this->lastname = $lastname;
|
|
}
|
|
|
|
public function getBirthdate() {
|
|
return $this->birthdate;
|
|
}
|
|
|
|
public function setBirthdate($birthdate) {
|
|
$this->birthdate = $birthdate;
|
|
}
|
|
|
|
public function getGender() {
|
|
return $this->gender;
|
|
}
|
|
|
|
public function setGender(Gender $gender) {
|
|
$this->gender = $gender;
|
|
}
|
|
// __toString Methode
|
|
public function __toString() {
|
|
return "Vorname: {$this->firstname}\n" .
|
|
"Nachname: {$this->lastname}\n" .
|
|
"Geburtsdatum: {$this->birthdate}\n" .
|
|
"Geschlecht: {$this->gender->value}\n" .
|
|
"Benutzername: {$this->userEmail->getUsername()}\n";
|
|
}
|
|
}
|
|
|
|
?>
|