diff options
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 | ||