diff options
Diffstat (limited to 'src/model/entities/Email.php')
-rw-r--r-- | src/model/entities/Email.php | 41 |
1 files changed, 41 insertions, 0 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 | } | ||