src/Contact/ContactDto.php line 7

  1. <?php
  2. namespace Cms\Contact;
  3. use Symfony\Component\Validator\Constraints as Assert;
  4. class ContactDto
  5. {
  6.     #[Assert\NotBlank]
  7.     protected string $name;
  8.     #[Assert\Email()]
  9.     #[Assert\NotBlank()]
  10.     protected string $email;
  11.     #[Assert\NotBlank]
  12.     protected string $subject;
  13.     #[Assert\NotBlank]
  14.     protected string $message;
  15.     protected \DateTimeImmutable $createdAt;
  16.     public function getName(): string
  17.     {
  18.         return $this->name;
  19.     }
  20.     public function setName(string $name): ContactDto
  21.     {
  22.         $this->name $name;
  23.         return $this;
  24.     }
  25.     public function getEmail(): string
  26.     {
  27.         return $this->email;
  28.     }
  29.     public function setEmail(string $email): ContactDto
  30.     {
  31.         $this->email $email;
  32.         return $this;
  33.     }
  34.     public function getSubject(): string
  35.     {
  36.         return $this->subject;
  37.     }
  38.     public function setSubject(string $subject): ContactDto
  39.     {
  40.         $this->subject $subject;
  41.         return $this;
  42.     }
  43.     public function getMessage(): string
  44.     {
  45.         return $this->message;
  46.     }
  47.     public function setMessage(string $message): ContactDto
  48.     {
  49.         $this->message $message;
  50.         return $this;
  51.     }
  52.     public function getCreatedAt(): \DateTimeImmutable
  53.     {
  54.         return $this->createdAt;
  55.     }
  56.     public function setCreatedAt(\DateTimeImmutable $createdAt): ContactDto
  57.     {
  58.         $this->createdAt $createdAt;
  59.         return $this;
  60.     }
  61. }