diff options
| author | polo <ordipolo@gmx.fr> | 2026-03-24 22:39:29 +0100 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2026-03-24 22:40:33 +0100 |
| commit | 3b369122645b07b290f7fcc7bccb4787745cd5ea (patch) | |
| tree | 3f9c2d1fbd5fe8b26162202e9b1e6cd5c8a940f6 /src/model/entities | |
| parent | a70dee9b5021a137ae07041c38921553442b0c11 (diff) | |
| download | cms-3b369122645b07b290f7fcc7bccb4787745cd5ea.tar.gz cms-3b369122645b07b290f7fcc7bccb4787745cd5ea.tar.bz2 cms-3b369122645b07b290f7fcc7bccb4787745cd5ea.zip | |
mode maintenance, optimisation moins de contrôles en mode run, dossier service et déplacement fichiers, sessions et entité User préparées à l'implémentation hypothétique des rôles, entité AppMetadata, meilleure sécurité de fillStartingDatabase
Diffstat (limited to 'src/model/entities')
| -rw-r--r-- | src/model/entities/AppMetadata.php | 46 | ||||
| -rw-r--r-- | src/model/entities/User.php | 19 |
2 files changed, 64 insertions, 1 deletions
diff --git a/src/model/entities/AppMetadata.php b/src/model/entities/AppMetadata.php new file mode 100644 index 0000000..ae42ad9 --- /dev/null +++ b/src/model/entities/AppMetadata.php | |||
| @@ -0,0 +1,46 @@ | |||
| 1 | <?php | ||
| 2 | // src/model/entities/AppMetadata.php | ||
| 3 | |||
| 4 | // comme dans AppMode, prévoir d'ajouter des champs "since" et "by" (qui a changé quoi quel jour?) | ||
| 5 | |||
| 6 | declare(strict_types=1); | ||
| 7 | |||
| 8 | namespace App\Entity; | ||
| 9 | |||
| 10 | use Doctrine\ORM\Mapping as ORM; | ||
| 11 | |||
| 12 | #[ORM\Entity] | ||
| 13 | #[ORM\Table(name: TABLE_PREFIX . "app_metadata")] | ||
| 14 | class AppMetadata | ||
| 15 | { | ||
| 16 | #[ORM\Id] | ||
| 17 | #[ORM\Column(type: "string", length: 100)] | ||
| 18 | private string $key_name; | ||
| 19 | |||
| 20 | #[ORM\Column(type: "string")] | ||
| 21 | private string $value; | ||
| 22 | |||
| 23 | public function __construct(string $key, string $value) | ||
| 24 | { | ||
| 25 | $this->key_name = $key; | ||
| 26 | $this->value = $value; | ||
| 27 | } | ||
| 28 | |||
| 29 | public function getKey(): string | ||
| 30 | { | ||
| 31 | return $this->key_name; | ||
| 32 | } | ||
| 33 | public function getValue(): string | ||
| 34 | { | ||
| 35 | return $this->value; | ||
| 36 | } | ||
| 37 | |||
| 38 | public function setKey(string $key): void | ||
| 39 | { | ||
| 40 | $this->key_name = $key; | ||
| 41 | } | ||
| 42 | public function setValue(string $value): void | ||
| 43 | { | ||
| 44 | $this->value = $value; | ||
| 45 | } | ||
| 46 | } \ No newline at end of file | ||
diff --git a/src/model/entities/User.php b/src/model/entities/User.php index 26802e2..36bc4db 100644 --- a/src/model/entities/User.php +++ b/src/model/entities/User.php | |||
| @@ -22,15 +22,24 @@ class User | |||
| 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 | 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; | 23 | private string $login; |
| 24 | 24 | ||
| 25 | #[ORM\Column(type: "string", length: 50)] | ||
| 26 | private string $role; | ||
| 27 | |||
| 25 | #[ORM\Column(type: "string", length: 255)] | 28 | #[ORM\Column(type: "string", length: 255)] |
| 26 | private string $password; | 29 | private string $password; |
| 27 | 30 | ||
| 28 | public function __construct(string $login, string $password) | 31 | public function __construct(string $login, string $role, string $password) |
| 29 | { | 32 | { |
| 30 | $this->login = $login; | 33 | $this->login = $login; |
| 34 | $this->role = $role; | ||
| 31 | $this->password = $password; | 35 | $this->password = $password; |
| 32 | } | 36 | } |
| 33 | 37 | ||
| 38 | public function getId(): int | ||
| 39 | { | ||
| 40 | return $this->id_user; | ||
| 41 | } | ||
| 42 | |||
| 34 | public function getLogin(): string | 43 | public function getLogin(): string |
| 35 | { | 44 | { |
| 36 | return $this->login; | 45 | return $this->login; |
| @@ -39,6 +48,14 @@ class User | |||
| 39 | { | 48 | { |
| 40 | $this->login = $login; | 49 | $this->login = $login; |
| 41 | } | 50 | } |
| 51 | public function getRole(): string | ||
| 52 | { | ||
| 53 | return $this->role; | ||
| 54 | } | ||
| 55 | public function setRole(string $role): void | ||
| 56 | { | ||
| 57 | $this->role = $role; | ||
| 58 | } | ||
| 42 | public function getPassword(): string | 59 | public function getPassword(): string |
| 43 | { | 60 | { |
| 44 | return $this->password; | 61 | return $this->password; |
