<?php
namespace App\Entity;
use App\Entity\Auth\AuthUser;
use App\Repository\SupportRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\SearchFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\OrderFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\DateFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\BooleanFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\RangeFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter\ExistsFilter;
/**
* @ApiResource(attributes={
* "normalization_context"={"groups"={"support"}},
* "filters"= { "several","support.search"},
* "pagination_client_enabled"=true
* })
* @ApiFilter(SearchFilter::class, properties={"organisation": "exact","ancienId": "exact","nom": "partial","audience": "partial",
* "precisions": "partial","positionnement": "partial","cible": "partial","typeMedia.id": "exact","etat.id": "exact","secteurs.id": "exact",
* "famille.id": "exact","periodicite.id": "exact","zoneDiffusion.id": "exact","auteur.id": "exact","casier.id": "exact",
* "organisation.id": "exact","emissions.id": "exact","emissionsDetenues.id": "exact"})
* @ApiFilter(DateFilter::class, properties={"creation"})
* @ApiFilter(RangeFilter::class, properties={"audience"})
* @ApiFilter(BooleanFilter::class, properties={"disponibilite"})
* @ApiFilter(ExistsFilter::class, properties={"emissions"})
* @ApiFilter(OrderFilter::class, properties={"id": "ASC", "nom": "ASC"}, arguments={"orderParameterName" : "order"})
* @ORM\Entity(repositoryClass=SupportRepository::class)
*/
class Support
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @Groups({"support","suivi","contact_organisation","organisation","contact","contact_support", "liste_contact_contact", "categories_generales", "sous_categories_generales","parution","emission"})
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
* @Groups({"support","contact_organisation","contact_support","suivi","contact", "liste_contact_contact", "categories_generales", "sous_categories_generales","parution","emission"})
*/
private $nom;
/**
* @ORM\Column(type="string", nullable=true)
* @Groups({"support"})
*/
private $dateParution;
/**
* @ORM\Column(type="string", nullable=true)
* @Groups({"support"})
*/
private $dateBouclage;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"support"})
*/
private $audience;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"support"})
*/
private $mediametrie;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"support"})
*/
private $OJD;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"support"})
*/
private $equivPub;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"support"})
*/
private $precisions;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"support"})
*/
private $positionnement;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"support"})
*/
private $cible;
/**
* @ORM\Column(type="string", length=5000, nullable=true)
* @Groups({"support"})
*/
private $commentaires;
/**
* @ORM\Column(type="boolean", nullable=true)
* @Groups({"support"})
*/
private $disponibilite;
/**
* @ORM\ManyToOne(targetEntity=Casier::class, inversedBy="supports")
* @Groups({"support"})
*/
private $casier;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"support"})
*/
private $exempDispo;
/**
* @ORM\ManyToOne(targetEntity=TypeMedia::class, inversedBy="supports")
* @Groups({"support"})
*/
private $typeMedia;
/**
* @ORM\ManyToOne(targetEntity=Etat::class, inversedBy="supports")
* @Groups({"support"})
*/
private $etat;
/**
* @ORM\ManyToOne(targetEntity=Organisation::class, inversedBy="supports")
* @Groups({"support"})
*/
private $organisation;
/**
* @ORM\ManyToOne(targetEntity=Famille::class, inversedBy="supports")
* @Groups({"support"})
*/
private $famille;
/**
* @ORM\ManyToOne(targetEntity=Periodicite::class, inversedBy="supports")
* @Groups({"support"})
*/
private $periodicite;
/**
* @ORM\ManyToOne(targetEntity=TypeOJD::class, inversedBy="supports")
* @Groups({"support"})
*/
private $typeOJD;
/**
* @ORM\ManyToOne(targetEntity=ZoneDiffusion::class, inversedBy="supports")
* @Groups({"support"})
*/
private $zoneDiffusion;
/**
* @ORM\OneToOne(targetEntity=Coordonnees::class, inversedBy="support")
* @Groups({"support","contact_support"})
*/
private $coordonnees;
/**
* @ORM\Column(type="integer", nullable=true)
* @Groups({"support","contact_support","suivi", "liste_contact_contact", "categories_generales","contact", "sous_categories_generales","parution","emission"})
*/
private $ancienId;
/**
* @ORM\ManyToOne(targetEntity=AuthUser::class)
* @Groups({"support"})
*/
private $auteur;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"support"})
*/
private $creation;
/**
* @ORM\Column(type="datetime", nullable=true)
* @Groups({"support"})
*/
private $modification;
/**
* @ORM\ManyToMany(targetEntity=Langues::class, inversedBy="supports")
* @Groups({"support"})
*/
private $langues;
/**
* @ORM\ManyToMany(targetEntity=Pays::class, inversedBy="supports")
* @Groups({"support"})
*/
private $pays;
/**
* @ORM\ManyToMany(targetEntity=Secteur::class, inversedBy="supports")
* @Groups({"support"})
*/
private $secteurs;
/**
* @ORM\OneToMany(targetEntity=Emission::class, mappedBy="support")
*/
private $emissions;
/**
* @ORM\OneToMany(targetEntity=CalendrierRedactionnel::class, mappedBy="support")
*/
private $calendrierRedactionnels;
/**
* @ORM\ManyToMany(targetEntity=Suivi::class, mappedBy="supports")
*/
private $suivis;
/**
* @ORM\OneToMany(targetEntity=ContactSupport::class, mappedBy="support")
*/
private $contactSupports;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"support","contact_support"})
*/
private $telStandard;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @Groups({"support","contact_support"})
*/
private $telPublicite;
/**
* @ORM\OneToOne(targetEntity=LogoSupport::class)
* @ORM\JoinColumn(name="logo_support_id",referencedColumnName="id", nullable=true)
* @Groups({"support","contact_support"})
*/
private $logoSupport;
/**
* @ORM\OneToMany(targetEntity=Emission::class, mappedBy="appartenirA")
*/
private $emissionsDetenues;
public function __construct()
{
$this->langues = new ArrayCollection();
$this->pays = new ArrayCollection();
$this->secteurs = new ArrayCollection();
$this->emissions = new ArrayCollection();
$this->calendrierRedactionnels = new ArrayCollection();
$this->suivis = new ArrayCollection();
$this->contactSupports = new ArrayCollection();
$this->emissionsDetenues = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getNom(): ?string
{
return $this->nom;
}
public function setNom(string $nom): self
{
$this->nom = $nom;
return $this;
}
/**
* @return mixed
*/
public function getDateParution()
{
return $this->dateParution;
}
/**
* @param mixed $dateParution
*/
public function setDateParution($dateParution): void
{
$this->dateParution = $dateParution;
}
/**
* @return mixed
*/
public function getDateBouclage()
{
return $this->dateBouclage;
}
/**
* @param mixed $dateBouclage
*/
public function setDateBouclage($dateBouclage): void
{
$this->dateBouclage = $dateBouclage;
}
public function getAudience(): ?int
{
return $this->audience;
}
public function setAudience(?int $audience): self
{
$this->audience = $audience;
return $this;
}
public function getMediametrie(): ?int
{
return $this->mediametrie;
}
public function setMediametrie(?int $mediametrie): self
{
$this->mediametrie = $mediametrie;
return $this;
}
public function getOJD(): ?int
{
return $this->OJD;
}
public function setOJD(?int $OJD): self
{
$this->OJD = $OJD;
return $this;
}
public function getEquivPub(): ?int
{
return $this->equivPub;
}
public function setEquivPub(?int $equivPub): self
{
$this->equivPub = $equivPub;
return $this;
}
public function getPrecisions(): ?string
{
return $this->precisions;
}
public function setPrecisions(?string $precisions): self
{
$this->precisions = $precisions;
return $this;
}
public function getPositionnement(): ?string
{
return $this->positionnement;
}
public function setPositionnement(?string $positionnement): self
{
$this->positionnement = $positionnement;
return $this;
}
public function getCible(): ?string
{
return $this->cible;
}
public function setCible(?string $cible): self
{
$this->cible = $cible;
return $this;
}
public function getCommentaires(): ?string
{
return $this->commentaires;
}
public function setCommentaires(?string $commentaires): self
{
$this->commentaires = $commentaires;
return $this;
}
public function getDisponibilite(): ?bool
{
return $this->disponibilite;
}
public function setDisponibilite(?bool $disponibilite): self
{
$this->disponibilite = $disponibilite;
return $this;
}
public function getCasier(): ?Casier
{
return $this->casier;
}
public function setCasier(?Casier $casier): self
{
$this->casier = $casier;
return $this;
}
public function getExempDispo(): ?string
{
return $this->exempDispo;
}
public function setExempDispo(?string $exempDispo): self
{
$this->exempDispo = $exempDispo;
return $this;
}
public function getTypeMedia(): ?TypeMedia
{
return $this->typeMedia;
}
public function setTypeMedia(?TypeMedia $typeMedia): self
{
$this->typeMedia = $typeMedia;
return $this;
}
public function getEtat(): ?Etat
{
return $this->etat;
}
public function setEtat(?Etat $etat): self
{
$this->etat = $etat;
return $this;
}
public function getOrganisation(): ?Organisation
{
return $this->organisation;
}
public function setOrganisation(?Organisation $organisation): self
{
$this->organisation = $organisation;
return $this;
}
public function getFamille(): ?Famille
{
return $this->famille;
}
public function setFamille(?Famille $famille): self
{
$this->famille = $famille;
return $this;
}
public function getPeriodicite(): ?Periodicite
{
return $this->periodicite;
}
public function setPeriodicite(?Periodicite $periodicite): self
{
$this->periodicite = $periodicite;
return $this;
}
public function getTypeOJD(): ?TypeOJD
{
return $this->typeOJD;
}
public function setTypeOJD(?TypeOJD $typeOJD): self
{
$this->typeOJD = $typeOJD;
return $this;
}
public function getZoneDiffusion(): ?ZoneDiffusion
{
return $this->zoneDiffusion;
}
public function setZoneDiffusion(?ZoneDiffusion $zoneDiffusion): self
{
$this->zoneDiffusion = $zoneDiffusion;
return $this;
}
public function getCoordonnees(): ?Coordonnees
{
return $this->coordonnees;
}
public function setCoordonnees(?Coordonnees $coordonnees): self
{
$this->coordonnees = $coordonnees;
return $this;
}
public function getAncienId(): ?int
{
return $this->ancienId;
}
public function setAncienId(?int $ancienId): self
{
$this->ancienId = $ancienId;
return $this;
}
public function getAuteur(): ?AuthUser
{
return $this->auteur;
}
public function setAuteur(?AuthUser $auteur): self
{
$this->auteur = $auteur;
return $this;
}
public function getCreation(): ?\DateTimeInterface
{
return $this->creation;
}
public function setCreation(?\DateTimeInterface $creation): self
{
$this->creation = $creation;
return $this;
}
public function getModification(): ?\DateTimeInterface
{
return $this->modification;
}
public function setModification(?\DateTimeInterface $modification): self
{
$this->modification = $modification;
return $this;
}
/**
* @return Collection|Langues[]
*/
public function getLangues(): Collection
{
return $this->langues;
}
public function addLangue(Langues $langue): self
{
if (!$this->langues->contains($langue)) {
$this->langues[] = $langue;
}
return $this;
}
public function removeLangue(Langues $langue): self
{
$this->langues->removeElement($langue);
return $this;
}
/**
* @return Collection|Pays[]
*/
public function getPays(): Collection
{
return $this->pays;
}
public function addPay(Pays $pay): self
{
if (!$this->pays->contains($pay)) {
$this->pays[] = $pay;
}
return $this;
}
public function removePay(Pays $pay): self
{
$this->pays->removeElement($pay);
return $this;
}
/**
* @return Collection|Secteur[]
*/
public function getSecteurs(): Collection
{
return $this->secteurs;
}
public function addSecteur(Secteur $secteur): self
{
if (!$this->secteurs->contains($secteur)) {
$this->secteurs[] = $secteur;
}
return $this;
}
public function removeSecteur(Secteur $secteur): self
{
$this->secteurs->removeElement($secteur);
return $this;
}
/**
* @return Collection|Emission[]
*/
public function getEmissions(): Collection
{
return $this->emissions;
}
public function addEmission(Emission $emission): self
{
if (!$this->emissions->contains($emission)) {
$this->emissions[] = $emission;
$emission->setSupport($this);
}
return $this;
}
public function removeEmission(Emission $emission): self
{
if ($this->emissions->removeElement($emission)) {
// set the owning side to null (unless already changed)
if ($emission->getSupport() === $this) {
$emission->setSupport(null);
}
}
return $this;
}
/**
* @return Collection|CalendrierRedactionnel[]
*/
public function getCalendrierRedactionnels(): Collection
{
return $this->calendrierRedactionnels;
}
public function addCalendrierRedactionnel(CalendrierRedactionnel $calendrierRedactionnel): self
{
if (!$this->calendrierRedactionnels->contains($calendrierRedactionnel)) {
$this->calendrierRedactionnels[] = $calendrierRedactionnel;
$calendrierRedactionnel->setSupport($this);
}
return $this;
}
public function removeCalendrierRedactionnel(CalendrierRedactionnel $calendrierRedactionnel): self
{
if ($this->calendrierRedactionnels->removeElement($calendrierRedactionnel)) {
// set the owning side to null (unless already changed)
if ($calendrierRedactionnel->getSupport() === $this) {
$calendrierRedactionnel->setSupport(null);
}
}
return $this;
}
/**
* @return Collection|Suivi[]
*/
public function getSuivis(): Collection
{
return $this->suivis;
}
public function addSuivi(Suivi $suivi): self
{
if (!$this->suivis->contains($suivi)) {
$this->suivis[] = $suivi;
$suivi->addSupport($this);
}
return $this;
}
public function removeSuivi(Suivi $suivi): self
{
if ($this->suivis->removeElement($suivi)) {
$suivi->removeSupport($this);
}
return $this;
}
/**
* @return Collection|ContactSupport[]
*/
public function getContactSupports(): Collection
{
return $this->contactSupports;
}
public function addContactSupport(ContactSupport $contactSupport): self
{
if (!$this->contactSupports->contains($contactSupport)) {
$this->contactSupports[] = $contactSupport;
$contactSupport->setSupport($this);
}
return $this;
}
public function removeContactSupport(ContactSupport $contactSupport): self
{
if ($this->contactSupports->removeElement($contactSupport)) {
// set the owning side to null (unless already changed)
if ($contactSupport->getSupport() === $this) {
$contactSupport->setSupport(null);
}
}
return $this;
}
public function getTelStandard(): ?string
{
return $this->telStandard;
}
public function setTelStandard(?string $telStandard): self
{
$this->telStandard = $telStandard;
return $this;
}
public function getTelPublicite(): ?string
{
return $this->telPublicite;
}
public function setTelPublicite(?string $telPublicite): self
{
$this->telPublicite = $telPublicite;
return $this;
}
public function getLogoSupport(): ?LogoSupport
{
return $this->logoSupport;
}
public function setLogoSupport(?LogoSupport $logoSupport): self
{
$this->logoSupport = $logoSupport;
return $this;
}
/**
* @return Collection|Emission[]
*/
public function getEmissionsDetenues(): Collection
{
return $this->emissionsDetenues;
}
public function addEmissionsDetenue(Emission $emissionsDetenue): self
{
if (!$this->emissionsDetenues->contains($emissionsDetenue)) {
$this->emissionsDetenues[] = $emissionsDetenue;
$emissionsDetenue->setAppartenirA($this);
}
return $this;
}
public function removeEmissionsDetenue(Emission $emissionsDetenue): self
{
if ($this->emissionsDetenues->removeElement($emissionsDetenue)) {
// set the owning side to null (unless already changed)
if ($emissionsDetenue->getAppartenirA() === $this) {
$emissionsDetenue->setAppartenirA(null);
}
}
return $this;
}
}