src/Entity/Common/HistoriqueEmail.php line 17

  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\Formations\Session\Planning\Event;
  7. use App\Entity\Gestiform\Quiz\Quiz;
  8. use App\Entity\Gestiform\Users\Employe;
  9. use App\Entity\Gestiform\Users\Personne;
  10. use App\Repository\Common\HistoriqueEmailRepository;
  11. use Doctrine\Common\Collections\ArrayCollection;
  12. use Doctrine\Common\Collections\Collection;
  13. use Doctrine\ORM\Mapping as ORM;
  14. #[ORM\Entity(repositoryClassHistoriqueEmailRepository::class)]
  15. class HistoriqueEmail extends AbstractEntity
  16. {
  17.     #[ORM\Column(name'sendTo'type'string'length255nullabletrue)]
  18.     private ?string $to null;
  19.     #[ORM\Column(name'sendFrom'type'string'length255nullabletrue)]
  20.     private ?string $from null;
  21.     #[ORM\Column(type'string'length255nullabletrue)]
  22.     private ?string $objet null;
  23.     #[ORM\Column(type'text'nullabletrue)]
  24.     private ?string $content null;
  25.     #[ORM\JoinColumn(nullabletrue)]
  26.     #[ORM\ManyToOne(targetEntityDossier::class, inversedBy'historiqueEmails')]
  27.     private ?Dossier $dossier null;
  28.     #[ORM\JoinColumn(nullabletrue)]
  29.     #[ORM\ManyToOne(targetEntityPersonne::class, inversedBy'historiqueEmails')]
  30.     private ?Personne $personne null;
  31.     #[ORM\JoinColumn(nullabletrue)]
  32.     #[ORM\ManyToOne(targetEntityEmploye::class, inversedBy'historiqueEmails')]
  33.     private ?Employe $employe null;
  34.     #[ORM\JoinColumn(nullabletrue)]
  35.     #[ORM\ManyToOne(targetEntityTemplate::class)]
  36.     private ?Template $template null;
  37.     #[ORM\JoinColumn(nullabletrue)]
  38.     #[ORM\ManyToOne(targetEntityEvent::class)]
  39.     private ?Event $event null;
  40.     #[ORM\JoinColumn(nullabletrue)]
  41.     #[ORM\ManyToOne(targetEntityQuiz::class)]
  42.     private ?Quiz $formulaire null;
  43.     #[ORM\OneToMany(mappedBy'historiqueEmail'targetEntityAttachment::class, cascade: ['all'])]
  44.     private Collection $attachments;
  45.     public function __construct()
  46.     {
  47.         $this->attachments = new ArrayCollection();
  48.     }
  49.     public function getTo(): ?string
  50.     {
  51.         return $this->to;
  52.     }
  53.     public function setTo(?string $to): self
  54.     {
  55.         $this->to $to;
  56.         return $this;
  57.     }
  58.     public function getFrom(): ?string
  59.     {
  60.         return $this->from;
  61.     }
  62.     public function setFrom(?string $from): self
  63.     {
  64.         $this->from $from;
  65.         return $this;
  66.     }
  67.     public function getObjet(): ?string
  68.     {
  69.         return $this->objet;
  70.     }
  71.     public function setObjet(?string $objet): self
  72.     {
  73.         $this->objet $objet;
  74.         return $this;
  75.     }
  76.     public function getContent(): ?string
  77.     {
  78.         return $this->content;
  79.     }
  80.     public function setContent(?string $content): self
  81.     {
  82.         $this->content $content;
  83.         return $this;
  84.     }
  85.     public function getDossier(): ?Dossier
  86.     {
  87.         return $this->dossier;
  88.     }
  89.     public function setDossier(?Dossier $dossier): self
  90.     {
  91.         $this->dossier $dossier;
  92.         return $this;
  93.     }
  94.     public function getPersonne(): ?Personne
  95.     {
  96.         return $this->personne;
  97.     }
  98.     public function setPersonne(?Personne $personne): self
  99.     {
  100.         $this->personne $personne;
  101.         return $this;
  102.     }
  103.     public function getTemplate(): ?Template
  104.     {
  105.         return $this->template;
  106.     }
  107.     public function setTemplate(?Template $template): self
  108.     {
  109.         $this->template $template;
  110.         return $this;
  111.     }
  112.     /**
  113.      * @return Collection<int, Attachment>
  114.      */
  115.     public function getAttachments(): Collection
  116.     {
  117.         return $this->attachments;
  118.     }
  119.     public function addAttachment(Attachment $attachment): self
  120.     {
  121.         if (!$this->attachments->contains($attachment)) {
  122.             $this->attachments->add($attachment);
  123.             $attachment->setHistoriqueEmail($this);
  124.         }
  125.         return $this;
  126.     }
  127.     public function removeAttachment(Attachment $attachment): self
  128.     {
  129.         // set the owning side to null (unless already changed)
  130.         if ($this->attachments->removeElement($attachment) && $attachment->getHistoriqueEmail() === $this) {
  131.             $attachment->setHistoriqueEmail(null);
  132.         }
  133.         return $this;
  134.     }
  135.     public function getEvent(): ?Event
  136.     {
  137.         return $this->event;
  138.     }
  139.     public function setEvent(?Event $event): self
  140.     {
  141.         $this->event $event;
  142.         return $this;
  143.     }
  144.     public function getFormulaire(): ?Quiz
  145.     {
  146.         return $this->formulaire;
  147.     }
  148.     public function setFormulaire(?Quiz $formulaire): self
  149.     {
  150.         $this->formulaire $formulaire;
  151.         return $this;
  152.     }
  153.     public function getEmploye(): ?Employe
  154.     {
  155.         return $this->employe;
  156.     }
  157.     public function setEmploye(?Employe $employe): self
  158.     {
  159.         $this->employe $employe;
  160.         return $this;
  161.     }
  162. }