src/Entity/Common/HistoriqueEmail.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Common;
  3. use App\Entity\AbstractEntity;
  4. use App\Entity\Gestiform\Admin\ModelsDocument\Template;
  5. use App\Entity\Gestiform\Formations\Dossier\Dossier;
  6. use App\Entity\Gestiform\Users\Personne;
  7. use App\Repository\Common\HistoriqueEmailRepository;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. /**
  12.  * @ORM\Entity(repositoryClass=HistoriqueEmailRepository::class)
  13.  */
  14. class HistoriqueEmail extends AbstractEntity
  15. {
  16.     /**
  17.      * @ORM\Column(name="sendTo",type="string", length=255,nullable=true)
  18.      */
  19.     private ?string $to null;
  20.     /**
  21.      * @ORM\Column(name="sendFrom",type="string", length=255,nullable=true)
  22.      */
  23.     private ?string $from null;
  24.     /**
  25.      * @ORM\Column(type="string", length=255,nullable=true)
  26.      */
  27.     private ?string $objet null;
  28.     /**
  29.      * @ORM\Column(type="text", nullable=true)
  30.      */
  31.     private ?string $content null;
  32.     /**
  33.      * @ORM\ManyToOne(targetEntity=Dossier::class, inversedBy="historiqueEmails")
  34.      * @ORM\JoinColumn(nullable=true)
  35.      */
  36.     private ?Dossier $dossier null;
  37.     /**
  38.      * @ORM\ManyToOne(targetEntity=Personne::class, inversedBy="historiqueEmails")
  39.      * @ORM\JoinColumn(nullable=true)
  40.      */
  41.     private ?Personne $personne null;
  42.     /**
  43.      * @ORM\ManyToOne(targetEntity=Template::class)
  44.      * @ORM\JoinColumn(nullable=true)
  45.      */
  46.     private ?Template $template null;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity=Attachment::class, cascade={"all"}, mappedBy="historiqueEmail")
  49.      */
  50.     private Collection $attachments;
  51.     public function __construct()
  52.     {
  53.         $this->attachments = new ArrayCollection();
  54.     }
  55.     public function getTo(): ?string
  56.     {
  57.         return $this->to;
  58.     }
  59.     public function setTo(?string $to): self
  60.     {
  61.         $this->to $to;
  62.         return $this;
  63.     }
  64.     public function getFrom(): ?string
  65.     {
  66.         return $this->from;
  67.     }
  68.     public function setFrom(?string $from): self
  69.     {
  70.         $this->from $from;
  71.         return $this;
  72.     }
  73.     public function getObjet(): ?string
  74.     {
  75.         return $this->objet;
  76.     }
  77.     public function setObjet(?string $objet): self
  78.     {
  79.         $this->objet $objet;
  80.         return $this;
  81.     }
  82.     public function getContent(): ?string
  83.     {
  84.         return $this->content;
  85.     }
  86.     public function setContent(?string $content): self
  87.     {
  88.         $this->content $content;
  89.         return $this;
  90.     }
  91.     public function getDossier(): ?Dossier
  92.     {
  93.         return $this->dossier;
  94.     }
  95.     public function setDossier(?Dossier $dossier): self
  96.     {
  97.         $this->dossier $dossier;
  98.         return $this;
  99.     }
  100.     public function getPersonne(): ?Personne
  101.     {
  102.         return $this->personne;
  103.     }
  104.     public function setPersonne(?Personne $personne): self
  105.     {
  106.         $this->personne $personne;
  107.         return $this;
  108.     }
  109.     public function getTemplate(): ?Template
  110.     {
  111.         return $this->template;
  112.     }
  113.     public function setTemplate(?Template $template): self
  114.     {
  115.         $this->template $template;
  116.         return $this;
  117.     }
  118.     /**
  119.      * @return Collection<int, Attachment>
  120.      */
  121.     public function getAttachments(): Collection
  122.     {
  123.         return $this->attachments;
  124.     }
  125.     public function addAttachment(Attachment $attachment): self
  126.     {
  127.         if (!$this->attachments->contains($attachment)) {
  128.             $this->attachments->add($attachment);
  129.             $attachment->setHistoriqueEmail($this);
  130.         }
  131.         return $this;
  132.     }
  133.     public function removeAttachment(Attachment $attachment): self
  134.     {
  135.         if ($this->attachments->removeElement($attachment)) {
  136.             // set the owning side to null (unless already changed)
  137.             if ($attachment->getHistoriqueEmail() === $this) {
  138.                 $attachment->setHistoriqueEmail(null);
  139.             }
  140.         }
  141.         return $this;
  142.     }
  143. }