diff options
| author | polo-pc-greta <ordipolo@gmx.fr> | 2025-03-27 10:13:03 +0100 |
|---|---|---|
| committer | polo-pc-greta <ordipolo@gmx.fr> | 2025-03-27 10:13:03 +0100 |
| commit | df3612ed7e6691530503f79483d2fdbc032d01b8 (patch) | |
| tree | 56d1c68fdc8625f5dad1937a654299d45142c79a /src/model/entities/User.php | |
| download | cms-df3612ed7e6691530503f79483d2fdbc032d01b8.tar.gz cms-df3612ed7e6691530503f79483d2fdbc032d01b8.tar.bz2 cms-df3612ed7e6691530503f79483d2fdbc032d01b8.zip | |
mise en ligne github
Diffstat (limited to 'src/model/entities/User.php')
| -rw-r--r-- | src/model/entities/User.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src/model/entities/User.php b/src/model/entities/User.php new file mode 100644 index 0000000..4b1dcb8 --- /dev/null +++ b/src/model/entities/User.php | |||
| @@ -0,0 +1,47 @@ | |||
| 1 | <?php | ||
| 2 | // src/model/entities/User.php | ||
| 3 | |||
| 4 | declare(strict_types=1); | ||
| 5 | |||
| 6 | namespace App\Entity; | ||
| 7 | |||
| 8 | use Doctrine\ORM\Mapping as ORM; | ||
| 9 | |||
| 10 | #[ORM\Entity] | ||
| 11 | #[ORM\Table(name: TABLE_PREFIX . "user")] | ||
| 12 | class User | ||
| 13 | { | ||
| 14 | #[ORM\Id] | ||
| 15 | #[ORM\GeneratedValue] | ||
| 16 | #[ORM\Column(type: "integer")] | ||
| 17 | private int $id_user; | ||
| 18 | |||
| 19 | /*#[ORM\Column(type: "string", length: 255)] | ||
| 20 | private string $name;*/ | ||
| 21 | |||
| 22 | #[ORM\Column(type: "string", length: 255, unique: true)] // risque de modifier son mot de passe sans s'apercevoir qu'il fonctionne encore sur un autre compte | ||
| 23 | private string $login; | ||
| 24 | |||
| 25 | #[ORM\Column(type: "string", length: 255)] | ||
| 26 | private string $password; | ||
| 27 | |||
| 28 | public function __construct(string $login, string $password) | ||
| 29 | { | ||
| 30 | $this->login = $login; | ||
| 31 | $this->password = $password; | ||
| 32 | } | ||
| 33 | |||
| 34 | public function getLogin(): string | ||
| 35 | { | ||
| 36 | return $this->login; | ||
| 37 | } | ||
| 38 | public function getPassword(): string | ||
| 39 | { | ||
| 40 | return $this->password; | ||
| 41 | } | ||
| 42 | |||
| 43 | public function setPassword(string $password): void | ||
| 44 | { | ||
| 45 | $this->password = $password; | ||
| 46 | } | ||
| 47 | } \ No newline at end of file | ||
