src/Entity/ApiMailRecipient.php line 19

Open in your IDE?
  1. <?php
  2.     namespace App\Entity;
  3.     use App\Repository\ApiMailRecipientRepository;
  4.     use Doctrine\ORM\Mapping as ORM;
  5.     use JMS\Serializer\Annotation as Serializer;
  6.     use JMS\Serializer\Annotation\Expose;
  7.     use JMS\Serializer\Annotation\Groups;
  8.     use Symfony\Component\Validator\Constraints as Assert;
  9.     /**
  10.      * Destinataires pour un envoi de mail
  11.      *
  12.      * @ORM\Entity(repositoryClass=ApiMailRecipientRepository::class)
  13.      *
  14.      * @Serializer\ExclusionPolicy("ALL")
  15.      */
  16.     class ApiMailRecipient
  17.     {
  18.         /**
  19.          * @ORM\Id
  20.          * @ORM\GeneratedValue
  21.          * @ORM\Column(type="integer")
  22.          *
  23.          * @Expose
  24.          * @Groups({"get"})
  25.          */
  26.         private ?int $id NULL;
  27.         /**
  28.          * Nom du destinataire
  29.          *
  30.          * @ORM\Column(type="string", length=255)
  31.          *
  32.          * @Assert\NotBlank
  33.          *
  34.          * @Expose
  35.          * @Groups({"get","post"})
  36.          */
  37.         private ?string $toName NULL;
  38.         /**
  39.          * Email du destinataire
  40.          * @ORM\Column(type="string", length=255)
  41.          *
  42.          * @Assert\NotBlank
  43.          * @Assert\Email
  44.          *
  45.          * @Expose
  46.          * @Groups({"get","post"})
  47.          */
  48.         private ?string $toEmail NULL;
  49.         /**
  50.          * Paramètres liés au destinataire (adresse, points, ...)
  51.          * @ORM\Column(type="json", nullable=true)
  52.          *
  53.          * @Expose
  54.          * @Groups({"post"})
  55.          *
  56.          */
  57.         private ?array $params = [];
  58.         /**
  59.          * @ORM\ManyToOne(targetEntity=ApiMailRequest::class, inversedBy="recipients")
  60.          * @ORM\JoinColumn(nullable=false)
  61.          */
  62.         private ?ApiMailRequest $apiMailRequest NULL;
  63.         public function getId(): ?int
  64.         {
  65.             return $this->id;
  66.         }
  67.         public function getToName(): string
  68.         {
  69.             return $this->toName;
  70.         }
  71.         public function setToName(string $toName): self
  72.         {
  73.             $this->toName $toName;
  74.             return $this;
  75.         }
  76.         public function getToEmail(): string
  77.         {
  78.             return $this->toEmail;
  79.         }
  80.         public function setToEmail(string $toEmail): self
  81.         {
  82.             $this->toEmail $toEmail;
  83.             return $this;
  84.         }
  85.         public function getParams(): ?array
  86.         {
  87.             return $this->params;
  88.         }
  89.         public function setParams(?array $params): self
  90.         {
  91.             $this->params $params;
  92.             return $this;
  93.         }
  94.         public function getApiMailRequest(): ApiMailRequest
  95.         {
  96.             return $this->apiMailRequest;
  97.         }
  98.         public function setApiMailRequest(?ApiMailRequest $apiMailRequest): self
  99.         {
  100.             $this->apiMailRequest $apiMailRequest;
  101.             return $this;
  102.         }
  103.     }