diff options
| author | polo <ordipolo@gmx.fr> | 2025-07-04 00:43:35 +0200 |
|---|---|---|
| committer | polo <ordipolo@gmx.fr> | 2025-07-04 00:43:35 +0200 |
| commit | 2d7bacce891eab0adb0263d598bfe44418788f42 (patch) | |
| tree | 4353250f80cc556a278640f22c194a0033d05829 /src/model/entities | |
| parent | ea3eaf84c6de3f96d6bb73e817147f8571fd6c1f (diff) | |
| download | cms-2d7bacce891eab0adb0263d598bfe44418788f42.tar.gz cms-2d7bacce891eab0adb0263d598bfe44418788f42.tar.bz2 cms-2d7bacce891eab0adb0263d598bfe44418788f42.zip | |
formulaire de contact 3
Diffstat (limited to 'src/model/entities')
| -rw-r--r-- | src/model/entities/Email.php | 41 | ||||
| -rw-r--r-- | src/model/entities/Log.php | 2 |
2 files changed, 41 insertions, 2 deletions
diff --git a/src/model/entities/Email.php b/src/model/entities/Email.php new file mode 100644 index 0000000..c6c2a29 --- /dev/null +++ b/src/model/entities/Email.php | |||
| @@ -0,0 +1,41 @@ | |||
| 1 | <?php | ||
| 2 | // src/model/entities/Email.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 . "email")] | ||
| 12 | class Email | ||
| 13 | { | ||
| 14 | #[ORM\Id] | ||
| 15 | #[ORM\GeneratedValue] | ||
| 16 | #[ORM\Column(type: "integer")] | ||
| 17 | private int $id_log; | ||
| 18 | |||
| 19 | #[ORM\Column(type: "string", length: 320)] | ||
| 20 | private string $sender; | ||
| 21 | |||
| 22 | #[ORM\Column(type: "string", length: 320)] | ||
| 23 | private string $recipient; | ||
| 24 | |||
| 25 | // inutile, objet = 'Message envoyé par ' . $name . ' (' . $email . ') depuis le site web' | ||
| 26 | /*#[ORM\Column(type: "text")] | ||
| 27 | private string $subject;*/ | ||
| 28 | |||
| 29 | #[ORM\Column(type: "text")] | ||
| 30 | private string $content; | ||
| 31 | |||
| 32 | #[ORM\Column(type: 'datetime', options: ['default' => 'CURRENT_TIMESTAMP'])] | ||
| 33 | private ?\DateTime $date_time ; | ||
| 34 | |||
| 35 | public function __construct(string $sender, string $recipient, string $content){ | ||
| 36 | $this->sender = $sender; | ||
| 37 | $this->recipient = $recipient; | ||
| 38 | $this->content = $content; | ||
| 39 | $this->date_time = new \DateTime(); | ||
| 40 | } | ||
| 41 | } | ||
diff --git a/src/model/entities/Log.php b/src/model/entities/Log.php index 06a907e..39b4307 100644 --- a/src/model/entities/Log.php +++ b/src/model/entities/Log.php | |||
| @@ -6,8 +6,6 @@ declare(strict_types=1); | |||
| 6 | namespace App\Entity; | 6 | namespace App\Entity; |
| 7 | 7 | ||
| 8 | use Doctrine\ORM\Mapping as ORM; | 8 | use Doctrine\ORM\Mapping as ORM; |
| 9 | use Doctrine\Common\Collections\ArrayCollection; | ||
| 10 | use Doctrine\Common\Collections\Collection; | ||
| 11 | 9 | ||
| 12 | #[ORM\Entity] | 10 | #[ORM\Entity] |
| 13 | #[ORM\Table(name: TABLE_PREFIX . "log")] | 11 | #[ORM\Table(name: TABLE_PREFIX . "log")] |
