abschluss
This commit is contained in:
47
app/Entity/User.php
Normal file
47
app/Entity/User.php
Normal file
@ -0,0 +1,47 @@
|
||||
<?php
|
||||
namespace Blog\Entity;
|
||||
|
||||
/**
|
||||
* Repräsentiert einen Benutzer mit ID, Benutzernamen und Passwort.
|
||||
*/
|
||||
class User {
|
||||
/**
|
||||
* Erstellt eine neue User-Instanz.
|
||||
*
|
||||
* @param int $id Die eindeutige ID des Benutzers.
|
||||
* @param string $username Der Benutzername.
|
||||
* @param string $password Das Passwort des Benutzers.
|
||||
*/
|
||||
public function __construct(
|
||||
private int $id,
|
||||
private string $username,
|
||||
private string $password
|
||||
) {}
|
||||
|
||||
/**
|
||||
* Gibt die ID des Benutzers zurück.
|
||||
*
|
||||
* @return int Die eindeutige ID des Benutzers.
|
||||
*/
|
||||
public function getId(): int {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt den Benutzernamen zurück.
|
||||
*
|
||||
* @return string Der Benutzername.
|
||||
*/
|
||||
public function getUsername(): string {
|
||||
return $this->username;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gibt das Passwort des Benutzers zurück.
|
||||
*
|
||||
* @return string Das Passwort.
|
||||
*/
|
||||
public function getPassword(): string {
|
||||
return $this->password;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user