|
|
@ -4,134 +4,187 @@ namespace model;
|
|
|
|
|
|
|
|
|
|
|
|
class User
|
|
|
|
class User
|
|
|
|
{
|
|
|
|
{
|
|
|
|
protected int $id;
|
|
|
|
private int $id;
|
|
|
|
protected String $mail;
|
|
|
|
private string $password;
|
|
|
|
protected String $name;
|
|
|
|
private string $email;
|
|
|
|
protected String $surname;
|
|
|
|
private string $name;
|
|
|
|
|
|
|
|
private string $surname;
|
|
|
|
|
|
|
|
private string $nickname;
|
|
|
|
|
|
|
|
private string $image;
|
|
|
|
|
|
|
|
private bool $extraTime;
|
|
|
|
|
|
|
|
private int $group;
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param int $id
|
|
|
|
* @param int $id
|
|
|
|
* @param string $mail
|
|
|
|
* @param string $password
|
|
|
|
|
|
|
|
* @param string $email
|
|
|
|
* @param string $name
|
|
|
|
* @param string $name
|
|
|
|
* @param string $surname
|
|
|
|
* @param string $surname
|
|
|
|
|
|
|
|
* @param string $nickname
|
|
|
|
|
|
|
|
* @param string $image
|
|
|
|
|
|
|
|
* @param bool $extraTime
|
|
|
|
|
|
|
|
* @param int $group
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function __construct(int $id, string $mail, string $name, string $surname)
|
|
|
|
public function __construct(int $id, string $password, string $email, string $name, string $surname, string $nickname, string $image, bool $extraTime, int $group)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->id = $id;
|
|
|
|
$this->id = $id;
|
|
|
|
$this->mail = $mail;
|
|
|
|
$this->password = $password;
|
|
|
|
|
|
|
|
$this->email = $email;
|
|
|
|
$this->name = $name;
|
|
|
|
$this->name = $name;
|
|
|
|
$this->surname = $surname;
|
|
|
|
$this->surname = $surname;
|
|
|
|
|
|
|
|
$this->nickname = $nickname;
|
|
|
|
|
|
|
|
$this->image = $image;
|
|
|
|
|
|
|
|
$this->extraTime = $extraTime;
|
|
|
|
|
|
|
|
$this->group = $group;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
|
|
|
|
public function changeMail(String $newMail){
|
|
|
|
/**
|
|
|
|
$this->mail = $newMail;
|
|
|
|
* @return int
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function getId(): int
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return $this->id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function changeName(String $newName){
|
|
|
|
/**
|
|
|
|
$this->name = $newName;
|
|
|
|
* @param int $id
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function setId(int $id): void
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$this->id = $id;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function changeSurname(String $newSurname){
|
|
|
|
/**
|
|
|
|
$this->surname = $newSurname;
|
|
|
|
* @return string
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function getPassword(): string
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return $this->password;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @return int|int
|
|
|
|
* @param string $password
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function getId()
|
|
|
|
public function setPassword(string $password): void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return $this->id;
|
|
|
|
$this->password = $password;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @return string|string
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function getMail()
|
|
|
|
public function getEmail(): string
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return $this->mail;
|
|
|
|
return $this->email;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @return string|string
|
|
|
|
* @param string $email
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function getName()
|
|
|
|
public function setEmail(string $email): void
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$this->email = $email;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @return string
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function getName(): string
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return $this->name;
|
|
|
|
return $this->name;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @return string|string
|
|
|
|
* @param string $name
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function setName(string $name): void
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$this->name = $name;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function getSurname()
|
|
|
|
public function getSurname(): string
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return $this->surname;
|
|
|
|
return $this->surname;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param int|int $id
|
|
|
|
* @param string $surname
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function setId($id)
|
|
|
|
public function setSurname(string $surname): void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->id = $id;
|
|
|
|
$this->surname = $surname;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param string|string $mail
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function setMail($mail)
|
|
|
|
public function getNickname(): string
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->mail = $mail;
|
|
|
|
return $this->nickname;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param string|string $name
|
|
|
|
* @param string $nickname
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function setName($name)
|
|
|
|
public function setNickname(string $nickname): void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->name = $name;
|
|
|
|
$this->nickname = $nickname;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @param string|string $surname
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function setSurname($surname)
|
|
|
|
public function getImage(): string
|
|
|
|
{
|
|
|
|
{
|
|
|
|
$this->surname = $surname;
|
|
|
|
return $this->image;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function __toString(): string
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @param string $image
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function setImage(string $image): void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return $this->id." ".$this->mail." ".$this->name." ".$this->surname;
|
|
|
|
$this->image = $image;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @return bool
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function getExtraTime(): bool
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return $this->extraTime;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @param bool $extraTime
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function setExtraTime(bool $extraTime): void
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$this->extraTime = $extraTime;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @return int
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function getGroup(): int
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return $this->group;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* @param int $group
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
public function setGroup(int $group): void
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
$this->group = $group;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function __toString(): string
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
return "User : ".$this->name." ".$this->surname." ".$this->nickname;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
/*
|
|
|
|
|
|
|
|
$u = new User(1,"mail","name","surname");
|
|
|
|
|
|
|
|
$res = $u->getMail();
|
|
|
|
|
|
|
|
echo "$res";
|
|
|
|
|
|
|
|
$u->changeMail("new_mail");
|
|
|
|
|
|
|
|
$res = $u->getMail();
|
|
|
|
|
|
|
|
echo "<br>";
|
|
|
|
|
|
|
|
echo "$res";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$res = $u->getName();
|
|
|
|
|
|
|
|
echo "<br>";
|
|
|
|
|
|
|
|
echo "$res";
|
|
|
|
|
|
|
|
$u->changeName("new_name");
|
|
|
|
|
|
|
|
$res = $u->getName();
|
|
|
|
|
|
|
|
echo "<br>";
|
|
|
|
|
|
|
|
echo "$res";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$res = $u->getSurname();
|
|
|
|
|
|
|
|
echo "<br>";
|
|
|
|
|
|
|
|
echo "$res";
|
|
|
|
|
|
|
|
$u->changeSurname("new_name");
|
|
|
|
|
|
|
|
$res = $u->getSurname();
|
|
|
|
|
|
|
|
echo "<br>";
|
|
|
|
|
|
|
|
echo "$res";
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|