src/Entity/TypeMail.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * TypeMail
  8.  */
  9. #[ORM\Table(name'type_mail')]
  10. #[ORM\Entity(repositoryClass\App\Repository\TypeMailRepository::class)]
  11. class TypeMail implements \Stringable
  12. {
  13.     #[ORM\Column(name'id'type'integer'nullablefalse)]
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue(strategy'IDENTITY')]
  16.     private readonly int $id;
  17.     #[ORM\Column(name'name_fr'type'text'nullabletrue)]
  18.     private string $nameFr;
  19.     #[ORM\Column(name'name_en'type'text'nullabletrue)]
  20.     private string $nameEn;
  21.     #[ORM\Column(name'name'type'text'nullabletrue)]
  22.     private string $name;
  23.     #[ORM\Column(name'bu'type'boolean'nullabletrue)]
  24.     private bool $bu false;
  25.     #[ORM\Column(name'marque'type'boolean'nullabletrue)]
  26.     private bool $marque false;
  27.     #[ORM\Column(name'sujet_fr'type'text'nullabletrue)]
  28.     private string $SujetFr;
  29.     #[ORM\Column(name'sujet_en'type'text'nullabletrue)]
  30.     private string $SujetEn;
  31.     #[ORM\Column(name'content_fr'type'text'nullabletrue)]
  32.     private string $ContentFr;
  33.     #[ORM\Column(name'content_en'type'text'nullabletrue)]
  34.     private string $ContentEn;
  35.     #[ORM\Column(name'destinataires'type'text'nullabletrue)]
  36.     private string $destinataires;
  37.     #[ORM\Column(name'demiJourn'type'boolean'nullabletrue)]
  38.     private bool $demijourn false;
  39.     #[ORM\Column(name'regulierDixMinutes'type'boolean'nullabletrue)]
  40.     private bool $regulierdixminutes false;
  41.     #[ORM\Column(name'actif'type'boolean'nullabletrue)]
  42.     private bool $actif false;
  43.     #[ORM\Column(name'groupe'type'text'nullabletrue)]
  44.     private ?string $groupe null;
  45.     #[ORM\Column(name'atelier'type'boolean'nullabletrue)]
  46.     private bool $atelier false;
  47.     #[ORM\Column(name'cotraitance'type'boolean'nullabletrue)]
  48.     private bool $cotraitance false;
  49.     #[ORM\Column(name'asie'type'boolean'nullabletrue)]
  50.     private bool $asie false;
  51.     #[ORM\JoinTable(name'typemail_groupe')]
  52.     #[ORM\ManyToMany(targetEntity\App\Entity\GroupesUtilisateur::class, inversedBy'typeMails')]
  53.     private $groupes;
  54.     #[ORM\JoinTable(name'typemail_groupe_copie')]
  55.     #[ORM\ManyToMany(targetEntity\App\Entity\GroupesUtilisateur::class, inversedBy'typeMailsCopie')]
  56.     private $groupes_copie;
  57.     #[ORM\OneToMany(targetEntityMailing::class, mappedBy'typemail')]
  58.     private $mailings;
  59.     public function __construct()
  60.     {
  61.         $this->groupes = new ArrayCollection();
  62.         $this->groupes_copie = new ArrayCollection();
  63.         $this->mailings = new ArrayCollection();
  64.     }
  65.     /**
  66.      * Get id
  67.      *
  68.      * @return integer
  69.      */
  70.     public function getId()
  71.     {
  72.         return $this->id;
  73.     }
  74.     /**
  75.      * Set nameFr
  76.      *
  77.      * @param string $nameFr
  78.      *
  79.      * @return TypeMail
  80.      */
  81.     public function setNameFr($nameFr)
  82.     {
  83.         $this->nameFr $nameFr;
  84.         return $this;
  85.     }
  86.     /**
  87.      * Get nameFr
  88.      *
  89.      * @return string
  90.      */
  91.     public function getNameFr()
  92.     {
  93.         return $this->nameFr;
  94.     }
  95.     /**
  96.      * Set nameEn
  97.      *
  98.      * @param string $nameEn
  99.      *
  100.      * @return TypeMail
  101.      */
  102.     public function setNameEn($nameEn)
  103.     {
  104.         $this->nameEn $nameEn;
  105.         return $this;
  106.     }
  107.     /**
  108.      * Get nameEn
  109.      *
  110.      * @return string
  111.      */
  112.     public function getNameEn()
  113.     {
  114.         return $this->nameEn;
  115.     }
  116.     /**
  117.      * Set name
  118.      *
  119.      * @param string $name
  120.      *
  121.      * @return TypeMail
  122.      */
  123.     public function setName($name)
  124.     {
  125.         $this->name $name;
  126.         return $this;
  127.     }
  128.     /**
  129.      * Get name
  130.      *
  131.      * @return string
  132.      */
  133.     public function getName()
  134.     {
  135.         return $this->name;
  136.     }
  137.     /**
  138.      * Set bu
  139.      *
  140.      * @param boolean $bu
  141.      *
  142.      * @return TypeMail
  143.      */
  144.     public function setBu($bu)
  145.     {
  146.         $this->bu $bu;
  147.         return $this;
  148.     }
  149.     /**
  150.      * Get bu
  151.      *
  152.      * @return boolean
  153.      */
  154.     public function getBu()
  155.     {
  156.         return $this->bu;
  157.     }
  158.     /**
  159.      * Set marque
  160.      *
  161.      * @param boolean $marque
  162.      *
  163.      * @return TypeMail
  164.      */
  165.     public function setMarque($marque)
  166.     {
  167.         $this->marque $marque;
  168.         return $this;
  169.     }
  170.     /**
  171.      * Get marque
  172.      *
  173.      * @return boolean
  174.      */
  175.     public function getMarque()
  176.     {
  177.         return $this->marque;
  178.     }
  179.     /**
  180.      * Set sujetFr
  181.      *
  182.      * @param string $sujetFr
  183.      *
  184.      * @return TypeMail
  185.      */
  186.     public function setSujetFr($sujetFr)
  187.     {
  188.         $this->SujetFr $sujetFr;
  189.         return $this;
  190.     }
  191.     /**
  192.      * Get sujetFr
  193.      *
  194.      * @return string
  195.      */
  196.     public function getSujetFr()
  197.     {
  198.         return $this->SujetFr;
  199.     }
  200.     /**
  201.      * Set sujetEn
  202.      *
  203.      * @param string $sujetEn
  204.      *
  205.      * @return TypeMail
  206.      */
  207.     public function setSujetEn($sujetEn)
  208.     {
  209.         $this->SujetEn $sujetEn;
  210.         return $this;
  211.     }
  212.     /**
  213.      * Get sujetEn
  214.      *
  215.      * @return string
  216.      */
  217.     public function getSujetEn()
  218.     {
  219.         return $this->SujetEn;
  220.     }
  221.     /**
  222.      * Set contentFr
  223.      *
  224.      * @param string $contentFr
  225.      *
  226.      * @return TypeMail
  227.      */
  228.     public function setContentFr($contentFr)
  229.     {
  230.         $this->ContentFr $contentFr;
  231.         return $this;
  232.     }
  233.     /**
  234.      * Get contentFr
  235.      *
  236.      * @return string
  237.      */
  238.     public function getContentFr()
  239.     {
  240.         return $this->ContentFr;
  241.     }
  242.     /**
  243.      * Set contentEn
  244.      *
  245.      * @param string $contentEn
  246.      *
  247.      * @return TypeMail
  248.      */
  249.     public function setContentEn($contentEn)
  250.     {
  251.         $this->ContentEn $contentEn;
  252.         return $this;
  253.     }
  254.     /**
  255.      * Get contentEn
  256.      *
  257.      * @return string
  258.      */
  259.     public function getContentEn()
  260.     {
  261.         return $this->ContentEn;
  262.     }
  263.     /**
  264.      * Set destinataires
  265.      *
  266.      * @param string $destinataires
  267.      *
  268.      * @return TypeMail
  269.      */
  270.     public function setDestinataires($destinataires)
  271.     {
  272.         $this->destinataires $destinataires;
  273.         return $this;
  274.     }
  275.     /**
  276.      * Get destinataires
  277.      *
  278.      * @return string
  279.      */
  280.     public function getDestinataires()
  281.     {
  282.         return $this->destinataires;
  283.     }
  284.     /**
  285.      * Set demijourn
  286.      *
  287.      * @param boolean $demijourn
  288.      *
  289.      * @return TypeMail
  290.      */
  291.     public function setDemijourn($demijourn)
  292.     {
  293.         $this->demijourn $demijourn;
  294.         return $this;
  295.     }
  296.     /**
  297.      * Get demijourn
  298.      *
  299.      * @return boolean
  300.      */
  301.     public function getDemijourn()
  302.     {
  303.         return $this->demijourn;
  304.     }
  305.     /**
  306.      * Set regulierdixminutes
  307.      *
  308.      * @param boolean $regulierdixminutes
  309.      *
  310.      * @return TypeMail
  311.      */
  312.     public function setRegulierdixminutes($regulierdixminutes)
  313.     {
  314.         $this->regulierdixminutes $regulierdixminutes;
  315.         return $this;
  316.     }
  317.     /**
  318.      * Get regulierdixminutes
  319.      *
  320.      * @return boolean
  321.      */
  322.     public function getRegulierdixminutes()
  323.     {
  324.         return $this->regulierdixminutes;
  325.     }
  326.     /**
  327.      * Set actif
  328.      *
  329.      * @param boolean $actif
  330.      *
  331.      * @return TypeMail
  332.      */
  333.     public function setActif($actif)
  334.     {
  335.         $this->actif $actif;
  336.         return $this;
  337.     }
  338.     /**
  339.      * Get actif
  340.      *
  341.      * @return boolean
  342.      */
  343.     public function getActif()
  344.     {
  345.         return $this->actif;
  346.     }
  347.     /**
  348.      * Set groupe
  349.      *
  350.      * @param string $groupe
  351.      *
  352.      * @return TypeMail
  353.      */
  354.     public function setGroupe(?string $groupe)
  355.     {
  356.         $this->groupe $groupe;
  357.         return $this;
  358.     }
  359.     /**
  360.      * Get groupe
  361.      *
  362.      * @return string
  363.      */
  364.     public function getGroupe(): ?string
  365.     {
  366.         return $this->groupe;
  367.     }
  368.     /**
  369.      * Set atelier
  370.      *
  371.      * @param boolean $atelier
  372.      *
  373.      * @return TypeMail
  374.      */
  375.     public function setAtelier($atelier)
  376.     {
  377.         $this->atelier $atelier;
  378.         return $this;
  379.     }
  380.     /**
  381.      * Get atelier
  382.      *
  383.      * @return boolean
  384.      */
  385.     public function getAtelier()
  386.     {
  387.         return $this->atelier;
  388.     }
  389.     /**
  390.      * Set cotraitance
  391.      *
  392.      * @param boolean $cotraitance
  393.      *
  394.      * @return TypeMail
  395.      */
  396.     public function setCotraitance($cotraitance)
  397.     {
  398.         $this->cotraitance $cotraitance;
  399.         return $this;
  400.     }
  401.     /**
  402.      * Get cotraitance
  403.      *
  404.      * @return boolean
  405.      */
  406.     public function getCotraitance()
  407.     {
  408.         return $this->cotraitance;
  409.     }
  410.     /**
  411.      * Set asie
  412.      *
  413.      * @param boolean $asie
  414.      *
  415.      * @return TypeMail
  416.      */
  417.     public function setAsie($asie)
  418.     {
  419.         $this->asie $asie;
  420.         return $this;
  421.     }
  422.     /**
  423.      * Get asie
  424.      *
  425.      * @return boolean
  426.      */
  427.     public function getAsie()
  428.     {
  429.         return $this->asie;
  430.     }
  431.     /**
  432.      * @return Collection|GroupesUtilisateur[]
  433.      */
  434.     public function getGroupes(): Collection
  435.     {
  436.         return $this->groupes;
  437.     }
  438.     public function addGroupe(GroupesUtilisateur $groupe): self
  439.     {
  440.         if (!$this->groupes->contains($groupe)) {
  441.             $this->groupes[] = $groupe;
  442.         }
  443.         return $this;
  444.     }
  445.     public function removeGroupe(GroupesUtilisateur $groupe): self
  446.     {
  447.         if ($this->groupes->contains($groupe)) {
  448.             $this->groupes->removeElement($groupe);
  449.         }
  450.         return $this;
  451.     }
  452.     /**
  453.      * @return Collection|GroupesUtilisateur[]
  454.      */
  455.     public function getGroupesCopie(): Collection
  456.     {
  457.         return $this->groupes_copie;
  458.     }
  459.     public function addGroupesCopie(GroupesUtilisateur $groupesCopie): self
  460.     {
  461.         if (!$this->groupes_copie->contains($groupesCopie)) {
  462.             $this->groupes_copie[] = $groupesCopie;
  463.         }
  464.         return $this;
  465.     }
  466.     public function removeGroupesCopie(GroupesUtilisateur $groupesCopie): self
  467.     {
  468.         if ($this->groupes_copie->contains($groupesCopie)) {
  469.             $this->groupes_copie->removeElement($groupesCopie);
  470.         }
  471.         return $this;
  472.     }
  473.     /**
  474.      * @return Collection|Mailing[]
  475.      */
  476.     public function getMailings(): Collection
  477.     {
  478.         return $this->mailings;
  479.     }
  480.     public function addMailing(Mailing $mailing): self
  481.     {
  482.         if (!$this->mailings->contains($mailing)) {
  483.             $this->mailings[] = $mailing;
  484.             $mailing->setTypemail($this);
  485.         }
  486.         return $this;
  487.     }
  488.     public function removeMailing(Mailing $mailing): self
  489.     {
  490.         if ($this->mailings->removeElement($mailing)) {
  491.             // set the owning side to null (unless already changed)
  492.             if ($mailing->getTypemail() === $this) {
  493.                 $mailing->setTypemail(null);
  494.             }
  495.         }
  496.         return $this;
  497.     }
  498.     public function __toString(): string
  499.     {
  500.         return $this->nameFr;
  501.     }
  502. }