src/Entity/Support.php line 37

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Auth\AuthUser;
  4. use App\Repository\SupportRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. use ApiPlatform\Core\Annotation\ApiResource;
  10. use ApiPlatform\Core\Annotation\ApiFilter;
  11. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
  12. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
  13. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter;
  14. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
  15. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\RangeFilter;
  16. use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\ExistsFilter;
  17. /**
  18.  * @ApiResource(attributes={
  19.  *     "normalization_context"={"groups"={"support"}},
  20.  *     "filters"= { "several","support.search"},
  21.  *     "pagination_client_enabled"=true
  22.  * })
  23.  * @ApiFilter(SearchFilter::class, properties={"organisation": "exact","ancienId": "exact","nom": "partial","audience": "partial",
  24.  *     "precisions": "partial","positionnement": "partial","cible": "partial","typeMedia.id": "exact","etat.id": "exact","secteurs.id": "exact",
  25.  *     "famille.id": "exact","periodicite.id": "exact","zoneDiffusion.id": "exact","auteur.id": "exact","casier.id": "exact",
  26.  *     "organisation.id": "exact","emissions.id": "exact","emissionsDetenues.id": "exact"})
  27.  * @ApiFilter(DateFilter::class, properties={"creation"})
  28.  * @ApiFilter(RangeFilter::class, properties={"audience"})
  29.  * @ApiFilter(BooleanFilter::class, properties={"disponibilite"})
  30.  * @ApiFilter(ExistsFilter::class, properties={"emissions"})
  31.  * @ApiFilter(OrderFilter::class, properties={"id": "ASC", "nom": "ASC"}, arguments={"orderParameterName" : "order"})
  32.  * @ORM\Entity(repositoryClass=SupportRepository::class)
  33.  */
  34. class Support
  35. {
  36.     /**
  37.      * @ORM\Id
  38.      * @ORM\GeneratedValue
  39.      * @ORM\Column(type="integer")
  40.      * @Groups({"support","suivi","contact_organisation","organisation","contact","contact_support", "liste_contact_contact", "categories_generales", "sous_categories_generales","parution","emission"})
  41.      */
  42.     private $id;
  43.     /**
  44.      * @ORM\Column(type="string", length=255)
  45.      * @Groups({"support","contact_organisation","contact_support","suivi","contact", "liste_contact_contact", "categories_generales", "sous_categories_generales","parution","emission"})
  46.      */
  47.     private $nom;
  48.     /**
  49.      * @ORM\Column(type="string", nullable=true)
  50.      * @Groups({"support"})
  51.      */
  52.     private $dateParution;
  53.     /**
  54.      * @ORM\Column(type="string", nullable=true)
  55.      * @Groups({"support"})
  56.      */
  57.     private $dateBouclage;
  58.     /**
  59.      * @ORM\Column(type="integer", nullable=true)
  60.      * @Groups({"support"})
  61.      */
  62.     private $audience;
  63.     /**
  64.      * @ORM\Column(type="integer", nullable=true)
  65.      * @Groups({"support"})
  66.      */
  67.     private $mediametrie;
  68.     /**
  69.      * @ORM\Column(type="integer", nullable=true)
  70.      * @Groups({"support"})
  71.      */
  72.     private $OJD;
  73.     /**
  74.      * @ORM\Column(type="integer", nullable=true)
  75.      * @Groups({"support"})
  76.      */
  77.     private $equivPub;
  78.     /**
  79.      * @ORM\Column(type="string", length=255, nullable=true)
  80.      * @Groups({"support"})
  81.      */
  82.     private $precisions;
  83.     /**
  84.      * @ORM\Column(type="string", length=255, nullable=true)
  85.      * @Groups({"support"})
  86.      */
  87.     private $positionnement;
  88.     /**
  89.      * @ORM\Column(type="string", length=255, nullable=true)
  90.      * @Groups({"support"})
  91.      */
  92.     private $cible;
  93.     /**
  94.      * @ORM\Column(type="string", length=5000, nullable=true)
  95.      * @Groups({"support"})
  96.      */
  97.     private $commentaires;
  98.     /**
  99.      * @ORM\Column(type="boolean", nullable=true)
  100.      * @Groups({"support"})
  101.      */
  102.     private $disponibilite;
  103.     /**
  104.      * @ORM\ManyToOne(targetEntity=Casier::class, inversedBy="supports")
  105.      * @Groups({"support"})
  106.      */
  107.     private $casier;
  108.     /**
  109.      * @ORM\Column(type="string", length=255, nullable=true)
  110.      * @Groups({"support"})
  111.      */
  112.     private $exempDispo;
  113.     /**
  114.      * @ORM\ManyToOne(targetEntity=TypeMedia::class, inversedBy="supports")
  115.      * @Groups({"support"})
  116.      */
  117.     private $typeMedia;
  118.     /**
  119.      * @ORM\ManyToOne(targetEntity=Etat::class, inversedBy="supports")
  120.      * @Groups({"support"})
  121.      */
  122.     private $etat;
  123.     /**
  124.      * @ORM\ManyToOne(targetEntity=Organisation::class, inversedBy="supports")
  125.      * @Groups({"support"})
  126.      */
  127.     private $organisation;
  128.     /**
  129.      * @ORM\ManyToOne(targetEntity=Famille::class, inversedBy="supports")
  130.      * @Groups({"support"})
  131.      */
  132.     private $famille;
  133.     /**
  134.      * @ORM\ManyToOne(targetEntity=Periodicite::class, inversedBy="supports")
  135.      * @Groups({"support"})
  136.      */
  137.     private $periodicite;
  138.     /**
  139.      * @ORM\ManyToOne(targetEntity=TypeOJD::class, inversedBy="supports")
  140.      * @Groups({"support"})
  141.      */
  142.     private $typeOJD;
  143.     /**
  144.      * @ORM\ManyToOne(targetEntity=ZoneDiffusion::class, inversedBy="supports")
  145.      * @Groups({"support"})
  146.      */
  147.     private $zoneDiffusion;
  148.     /**
  149.      * @ORM\OneToOne(targetEntity=Coordonnees::class, inversedBy="support")
  150.      * @Groups({"support","contact_support"})
  151.      */
  152.     private $coordonnees;
  153.     /**
  154.      * @ORM\Column(type="integer", nullable=true)
  155.      * @Groups({"support","contact_support","suivi", "liste_contact_contact", "categories_generales","contact", "sous_categories_generales","parution","emission"})
  156.      */
  157.     private $ancienId;
  158.     /**
  159.      * @ORM\ManyToOne(targetEntity=AuthUser::class)
  160.      * @Groups({"support"})
  161.      */
  162.     private $auteur;
  163.     /**
  164.      * @ORM\Column(type="datetime", nullable=true)
  165.      * @Groups({"support"})
  166.      */
  167.     private $creation;
  168.     /**
  169.      * @ORM\Column(type="datetime", nullable=true)
  170.      * @Groups({"support"})
  171.      */
  172.     private $modification;
  173.     /**
  174.      * @ORM\ManyToMany(targetEntity=Langues::class, inversedBy="supports")
  175.      * @Groups({"support"})
  176.      */
  177.     private $langues;
  178.     /**
  179.      * @ORM\ManyToMany(targetEntity=Pays::class, inversedBy="supports")
  180.      * @Groups({"support"})
  181.      */
  182.     private $pays;
  183.     /**
  184.      * @ORM\ManyToMany(targetEntity=Secteur::class, inversedBy="supports")
  185.      * @Groups({"support"})
  186.      */
  187.     private $secteurs;
  188.     /**
  189.      * @ORM\OneToMany(targetEntity=Emission::class, mappedBy="support")
  190.      */
  191.     private $emissions;
  192.     /**
  193.      * @ORM\OneToMany(targetEntity=CalendrierRedactionnel::class, mappedBy="support")
  194.      */
  195.     private $calendrierRedactionnels;
  196.     /**
  197.      * @ORM\ManyToMany(targetEntity=Suivi::class, mappedBy="supports")
  198.      */
  199.     private $suivis;
  200.     /**
  201.      * @ORM\OneToMany(targetEntity=ContactSupport::class, mappedBy="support")
  202.      */
  203.     private $contactSupports;
  204.     /**
  205.      * @ORM\Column(type="string", length=255, nullable=true)
  206.      * @Groups({"support","contact_support"})
  207.      */
  208.     private $telStandard;
  209.     /**
  210.      * @ORM\Column(type="string", length=255, nullable=true)
  211.      * @Groups({"support","contact_support"})
  212.      */
  213.     private $telPublicite;
  214.     /**
  215.      * @ORM\OneToOne(targetEntity=LogoSupport::class)
  216.      * @ORM\JoinColumn(name="logo_support_id",referencedColumnName="id", nullable=true)
  217.      * @Groups({"support","contact_support"})
  218.      */
  219.     private $logoSupport;
  220.     /**
  221.      * @ORM\OneToMany(targetEntity=Emission::class, mappedBy="appartenirA")
  222.      */
  223.     private $emissionsDetenues;
  224.     public function __construct()
  225.     {
  226.         $this->langues = new ArrayCollection();
  227.         $this->pays = new ArrayCollection();
  228.         $this->secteurs = new ArrayCollection();
  229.         $this->emissions = new ArrayCollection();
  230.         $this->calendrierRedactionnels = new ArrayCollection();
  231.         $this->suivis = new ArrayCollection();
  232.         $this->contactSupports = new ArrayCollection();
  233.         $this->emissionsDetenues = new ArrayCollection();
  234.     }
  235.     public function getId(): ?int
  236.     {
  237.         return $this->id;
  238.     }
  239.     public function getNom(): ?string
  240.     {
  241.         return $this->nom;
  242.     }
  243.     public function setNom(string $nom): self
  244.     {
  245.         $this->nom $nom;
  246.         return $this;
  247.     }
  248.     /**
  249.      * @return mixed
  250.      */
  251.     public function getDateParution()
  252.     {
  253.         return $this->dateParution;
  254.     }
  255.     /**
  256.      * @param mixed $dateParution
  257.      */
  258.     public function setDateParution($dateParution): void
  259.     {
  260.         $this->dateParution $dateParution;
  261.     }
  262.     /**
  263.      * @return mixed
  264.      */
  265.     public function getDateBouclage()
  266.     {
  267.         return $this->dateBouclage;
  268.     }
  269.     /**
  270.      * @param mixed $dateBouclage
  271.      */
  272.     public function setDateBouclage($dateBouclage): void
  273.     {
  274.         $this->dateBouclage $dateBouclage;
  275.     }
  276.     public function getAudience(): ?int
  277.     {
  278.         return $this->audience;
  279.     }
  280.     public function setAudience(?int $audience): self
  281.     {
  282.         $this->audience $audience;
  283.         return $this;
  284.     }
  285.     public function getMediametrie(): ?int
  286.     {
  287.         return $this->mediametrie;
  288.     }
  289.     public function setMediametrie(?int $mediametrie): self
  290.     {
  291.         $this->mediametrie $mediametrie;
  292.         return $this;
  293.     }
  294.     public function getOJD(): ?int
  295.     {
  296.         return $this->OJD;
  297.     }
  298.     public function setOJD(?int $OJD): self
  299.     {
  300.         $this->OJD $OJD;
  301.         return $this;
  302.     }
  303.     public function getEquivPub(): ?int
  304.     {
  305.         return $this->equivPub;
  306.     }
  307.     public function setEquivPub(?int $equivPub): self
  308.     {
  309.         $this->equivPub $equivPub;
  310.         return $this;
  311.     }
  312.     public function getPrecisions(): ?string
  313.     {
  314.         return $this->precisions;
  315.     }
  316.     public function setPrecisions(?string $precisions): self
  317.     {
  318.         $this->precisions $precisions;
  319.         return $this;
  320.     }
  321.     public function getPositionnement(): ?string
  322.     {
  323.         return $this->positionnement;
  324.     }
  325.     public function setPositionnement(?string $positionnement): self
  326.     {
  327.         $this->positionnement $positionnement;
  328.         return $this;
  329.     }
  330.     public function getCible(): ?string
  331.     {
  332.         return $this->cible;
  333.     }
  334.     public function setCible(?string $cible): self
  335.     {
  336.         $this->cible $cible;
  337.         return $this;
  338.     }
  339.     public function getCommentaires(): ?string
  340.     {
  341.         return $this->commentaires;
  342.     }
  343.     public function setCommentaires(?string $commentaires): self
  344.     {
  345.         $this->commentaires $commentaires;
  346.         return $this;
  347.     }
  348.     public function getDisponibilite(): ?bool
  349.     {
  350.         return $this->disponibilite;
  351.     }
  352.     public function setDisponibilite(?bool $disponibilite): self
  353.     {
  354.         $this->disponibilite $disponibilite;
  355.         return $this;
  356.     }
  357.     public function getCasier(): ?Casier
  358.     {
  359.         return $this->casier;
  360.     }
  361.     public function setCasier(?Casier $casier): self
  362.     {
  363.         $this->casier $casier;
  364.         return $this;
  365.     }
  366.     public function getExempDispo(): ?string
  367.     {
  368.         return $this->exempDispo;
  369.     }
  370.     public function setExempDispo(?string $exempDispo): self
  371.     {
  372.         $this->exempDispo $exempDispo;
  373.         return $this;
  374.     }
  375.     public function getTypeMedia(): ?TypeMedia
  376.     {
  377.         return $this->typeMedia;
  378.     }
  379.     public function setTypeMedia(?TypeMedia $typeMedia): self
  380.     {
  381.         $this->typeMedia $typeMedia;
  382.         return $this;
  383.     }
  384.     public function getEtat(): ?Etat
  385.     {
  386.         return $this->etat;
  387.     }
  388.     public function setEtat(?Etat $etat): self
  389.     {
  390.         $this->etat $etat;
  391.         return $this;
  392.     }
  393.     public function getOrganisation(): ?Organisation
  394.     {
  395.         return $this->organisation;
  396.     }
  397.     public function setOrganisation(?Organisation $organisation): self
  398.     {
  399.         $this->organisation $organisation;
  400.         return $this;
  401.     }
  402.     public function getFamille(): ?Famille
  403.     {
  404.         return $this->famille;
  405.     }
  406.     public function setFamille(?Famille $famille): self
  407.     {
  408.         $this->famille $famille;
  409.         return $this;
  410.     }
  411.     public function getPeriodicite(): ?Periodicite
  412.     {
  413.         return $this->periodicite;
  414.     }
  415.     public function setPeriodicite(?Periodicite $periodicite): self
  416.     {
  417.         $this->periodicite $periodicite;
  418.         return $this;
  419.     }
  420.     public function getTypeOJD(): ?TypeOJD
  421.     {
  422.         return $this->typeOJD;
  423.     }
  424.     public function setTypeOJD(?TypeOJD $typeOJD): self
  425.     {
  426.         $this->typeOJD $typeOJD;
  427.         return $this;
  428.     }
  429.     public function getZoneDiffusion(): ?ZoneDiffusion
  430.     {
  431.         return $this->zoneDiffusion;
  432.     }
  433.     public function setZoneDiffusion(?ZoneDiffusion $zoneDiffusion): self
  434.     {
  435.         $this->zoneDiffusion $zoneDiffusion;
  436.         return $this;
  437.     }
  438.     public function getCoordonnees(): ?Coordonnees
  439.     {
  440.         return $this->coordonnees;
  441.     }
  442.     public function setCoordonnees(?Coordonnees $coordonnees): self
  443.     {
  444.         $this->coordonnees $coordonnees;
  445.         return $this;
  446.     }
  447.     public function getAncienId(): ?int
  448.     {
  449.         return $this->ancienId;
  450.     }
  451.     public function setAncienId(?int $ancienId): self
  452.     {
  453.         $this->ancienId $ancienId;
  454.         return $this;
  455.     }
  456.     public function getAuteur(): ?AuthUser
  457.     {
  458.         return $this->auteur;
  459.     }
  460.     public function setAuteur(?AuthUser $auteur): self
  461.     {
  462.         $this->auteur $auteur;
  463.         return $this;
  464.     }
  465.     public function getCreation(): ?\DateTimeInterface
  466.     {
  467.         return $this->creation;
  468.     }
  469.     public function setCreation(?\DateTimeInterface $creation): self
  470.     {
  471.         $this->creation $creation;
  472.         return $this;
  473.     }
  474.     public function getModification(): ?\DateTimeInterface
  475.     {
  476.         return $this->modification;
  477.     }
  478.     public function setModification(?\DateTimeInterface $modification): self
  479.     {
  480.         $this->modification $modification;
  481.         return $this;
  482.     }
  483.     /**
  484.      * @return Collection|Langues[]
  485.      */
  486.     public function getLangues(): Collection
  487.     {
  488.         return $this->langues;
  489.     }
  490.     public function addLangue(Langues $langue): self
  491.     {
  492.         if (!$this->langues->contains($langue)) {
  493.             $this->langues[] = $langue;
  494.         }
  495.         return $this;
  496.     }
  497.     public function removeLangue(Langues $langue): self
  498.     {
  499.         $this->langues->removeElement($langue);
  500.         return $this;
  501.     }
  502.     /**
  503.      * @return Collection|Pays[]
  504.      */
  505.     public function getPays(): Collection
  506.     {
  507.         return $this->pays;
  508.     }
  509.     public function addPay(Pays $pay): self
  510.     {
  511.         if (!$this->pays->contains($pay)) {
  512.             $this->pays[] = $pay;
  513.         }
  514.         return $this;
  515.     }
  516.     public function removePay(Pays $pay): self
  517.     {
  518.         $this->pays->removeElement($pay);
  519.         return $this;
  520.     }
  521.     /**
  522.      * @return Collection|Secteur[]
  523.      */
  524.     public function getSecteurs(): Collection
  525.     {
  526.         return $this->secteurs;
  527.     }
  528.     public function addSecteur(Secteur $secteur): self
  529.     {
  530.         if (!$this->secteurs->contains($secteur)) {
  531.             $this->secteurs[] = $secteur;
  532.         }
  533.         return $this;
  534.     }
  535.     public function removeSecteur(Secteur $secteur): self
  536.     {
  537.         $this->secteurs->removeElement($secteur);
  538.         return $this;
  539.     }
  540.     /**
  541.      * @return Collection|Emission[]
  542.      */
  543.     public function getEmissions(): Collection
  544.     {
  545.         return $this->emissions;
  546.     }
  547.     public function addEmission(Emission $emission): self
  548.     {
  549.         if (!$this->emissions->contains($emission)) {
  550.             $this->emissions[] = $emission;
  551.             $emission->setSupport($this);
  552.         }
  553.         return $this;
  554.     }
  555.     public function removeEmission(Emission $emission): self
  556.     {
  557.         if ($this->emissions->removeElement($emission)) {
  558.             // set the owning side to null (unless already changed)
  559.             if ($emission->getSupport() === $this) {
  560.                 $emission->setSupport(null);
  561.             }
  562.         }
  563.         return $this;
  564.     }
  565.     /**
  566.      * @return Collection|CalendrierRedactionnel[]
  567.      */
  568.     public function getCalendrierRedactionnels(): Collection
  569.     {
  570.         return $this->calendrierRedactionnels;
  571.     }
  572.     public function addCalendrierRedactionnel(CalendrierRedactionnel $calendrierRedactionnel): self
  573.     {
  574.         if (!$this->calendrierRedactionnels->contains($calendrierRedactionnel)) {
  575.             $this->calendrierRedactionnels[] = $calendrierRedactionnel;
  576.             $calendrierRedactionnel->setSupport($this);
  577.         }
  578.         return $this;
  579.     }
  580.     public function removeCalendrierRedactionnel(CalendrierRedactionnel $calendrierRedactionnel): self
  581.     {
  582.         if ($this->calendrierRedactionnels->removeElement($calendrierRedactionnel)) {
  583.             // set the owning side to null (unless already changed)
  584.             if ($calendrierRedactionnel->getSupport() === $this) {
  585.                 $calendrierRedactionnel->setSupport(null);
  586.             }
  587.         }
  588.         return $this;
  589.     }
  590.     /**
  591.      * @return Collection|Suivi[]
  592.      */
  593.     public function getSuivis(): Collection
  594.     {
  595.         return $this->suivis;
  596.     }
  597.     public function addSuivi(Suivi $suivi): self
  598.     {
  599.         if (!$this->suivis->contains($suivi)) {
  600.             $this->suivis[] = $suivi;
  601.             $suivi->addSupport($this);
  602.         }
  603.         return $this;
  604.     }
  605.     public function removeSuivi(Suivi $suivi): self
  606.     {
  607.         if ($this->suivis->removeElement($suivi)) {
  608.             $suivi->removeSupport($this);
  609.         }
  610.         return $this;
  611.     }
  612.     /**
  613.      * @return Collection|ContactSupport[]
  614.      */
  615.     public function getContactSupports(): Collection
  616.     {
  617.         return $this->contactSupports;
  618.     }
  619.     public function addContactSupport(ContactSupport $contactSupport): self
  620.     {
  621.         if (!$this->contactSupports->contains($contactSupport)) {
  622.             $this->contactSupports[] = $contactSupport;
  623.             $contactSupport->setSupport($this);
  624.         }
  625.         return $this;
  626.     }
  627.     public function removeContactSupport(ContactSupport $contactSupport): self
  628.     {
  629.         if ($this->contactSupports->removeElement($contactSupport)) {
  630.             // set the owning side to null (unless already changed)
  631.             if ($contactSupport->getSupport() === $this) {
  632.                 $contactSupport->setSupport(null);
  633.             }
  634.         }
  635.         return $this;
  636.     }
  637.     public function getTelStandard(): ?string
  638.     {
  639.         return $this->telStandard;
  640.     }
  641.     public function setTelStandard(?string $telStandard): self
  642.     {
  643.         $this->telStandard $telStandard;
  644.         return $this;
  645.     }
  646.     public function getTelPublicite(): ?string
  647.     {
  648.         return $this->telPublicite;
  649.     }
  650.     public function setTelPublicite(?string $telPublicite): self
  651.     {
  652.         $this->telPublicite $telPublicite;
  653.         return $this;
  654.     }
  655.     public function getLogoSupport(): ?LogoSupport
  656.     {
  657.         return $this->logoSupport;
  658.     }
  659.     public function setLogoSupport(?LogoSupport $logoSupport): self
  660.     {
  661.         $this->logoSupport $logoSupport;
  662.         return $this;
  663.     }
  664.     /**
  665.      * @return Collection|Emission[]
  666.      */
  667.     public function getEmissionsDetenues(): Collection
  668.     {
  669.         return $this->emissionsDetenues;
  670.     }
  671.     public function addEmissionsDetenue(Emission $emissionsDetenue): self
  672.     {
  673.         if (!$this->emissionsDetenues->contains($emissionsDetenue)) {
  674.             $this->emissionsDetenues[] = $emissionsDetenue;
  675.             $emissionsDetenue->setAppartenirA($this);
  676.         }
  677.         return $this;
  678.     }
  679.     public function removeEmissionsDetenue(Emission $emissionsDetenue): self
  680.     {
  681.         if ($this->emissionsDetenues->removeElement($emissionsDetenue)) {
  682.             // set the owning side to null (unless already changed)
  683.             if ($emissionsDetenue->getAppartenirA() === $this) {
  684.                 $emissionsDetenue->setAppartenirA(null);
  685.             }
  686.         }
  687.         return $this;
  688.     }
  689. }