<?php
namespace App\Entity;
use App\Repository\ServiceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: ServiceRepository::class)]
class Service implements \Stringable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private int $id;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $titre= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $image_name= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $image_url= null;
#[ORM\ManyToMany(targetEntity: ServiceGrandProfil::class, inversedBy: 'services')]
private mixed $grandprofils;
#[ORM\ManyToMany(targetEntity: ServiceSousProfil::class, inversedBy: 'services')]
private mixed $sousprofils;
#[ORM\ManyToMany(targetEntity: ServiceTheme::class, inversedBy: 'services')]
private mixed $themes;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $chapo= null;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $url= null;
#[ORM\ManyToMany(targetEntity: PolitiqueDepartementale::class, mappedBy: 'services')]
private mixed $politiqueDepartementales;
#[ORM\Column(type: 'text', nullable: true)]
private ?string $content= null;
#[ORM\Column(type: 'integer', nullable: true)]
private ?int $nombre_visite;
#[ORM\Column(type: 'integer', nullable: true)]
private ?int $avis_positif;
#[ORM\Column(type: 'integer', nullable: true)]
private ?int $avis_negatif;
#[ORM\ManyToOne(targetEntity: Statut::class, inversedBy: 'services')]
private mixed $statut;
#[ORM\Column(type: 'datetime', nullable: true)]
private $date_update;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $alias_url= null;
#[ORM\ManyToMany(targetEntity: PageAccueilService::class, mappedBy: 'services')]
private mixed $pageAccueilServices;
#[ORM\ManyToMany(targetEntity: Epingle::class, mappedBy: 'visible_services_entity')]
private mixed $epingles;
#[ORM\Column(type: 'integer', nullable: true)]
private ?int $order_service;
#[ORM\Column(type: 'integer', nullable: true)]
private ?int $view_count;
#[ORM\OneToMany(targetEntity: ServiceFeedback::class, mappedBy: 'service')]
private mixed $serviceFeedback;
#[ORM\ManyToMany(targetEntity: PageSatellite::class, mappedBy: 'services')]
private Collection $pageSatellites;
public function __construct()
{
$this->grandprofils = new ArrayCollection();
$this->sousprofils = new ArrayCollection();
$this->themes = new ArrayCollection();
$this->politiqueDepartementales = new ArrayCollection();
$this->pageAccueilServices = new ArrayCollection();
$this->epingles = new ArrayCollection();
$this->serviceFeedback = new ArrayCollection();
$this->pageSatellites = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(?string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getImageName(): ?string
{
return $this->image_name;
}
public function setImageName(?string $image_name): self
{
$this->image_name = $image_name;
return $this;
}
public function getImageUrl(): ?string
{
return $this->image_url;
}
public function setImageUrl(?string $image_url): self
{
$this->image_url = $image_url;
return $this;
}
/**
* @return Collection|ServiceGrandProfil[]
*/
public function getGrandprofils(): Collection
{
return $this->grandprofils;
}
public function addGrandprofil(ServiceGrandProfil $grandprofil): self
{
if (!$this->grandprofils->contains($grandprofil)) {
$this->grandprofils[] = $grandprofil;
}
return $this;
}
public function removeGrandprofil(ServiceGrandProfil $grandprofil): self
{
$this->grandprofils->removeElement($grandprofil);
return $this;
}
/**
* @return Collection|ServiceSousProfil[]
*/
public function getSousprofils(): Collection
{
return $this->sousprofils;
}
public function addSousprofil(ServiceSousProfil $sousprofil): self
{
if (!$this->sousprofils->contains($sousprofil)) {
$this->sousprofils[] = $sousprofil;
}
return $this;
}
public function removeSousprofil(ServiceSousProfil $sousprofil): self
{
$this->sousprofils->removeElement($sousprofil);
return $this;
}
/**
* @return Collection|ServiceTheme[]
*/
public function getThemes(): Collection
{
return $this->themes;
}
public function addTheme(ServiceTheme $theme): self
{
if (!$this->themes->contains($theme)) {
$this->themes[] = $theme;
}
return $this;
}
public function removeTheme(ServiceTheme $theme): self
{
$this->themes->removeElement($theme);
return $this;
}
public function getChapo(): ?string
{
return $this->chapo;
}
public function setChapo(?string $chapo): self
{
$this->chapo = $chapo;
return $this;
}
public function getUrl(): ?string
{
return $this->url;
}
public function setUrl(?string $url): self
{
$this->url = $url;
return $this;
}
/**
* @return Collection|PolitiqueDepartementale[]
*/
public function getPolitiqueDepartementales(): Collection
{
return $this->politiqueDepartementales;
}
public function addPolitiqueDepartementale(PolitiqueDepartementale $politiqueDepartementale): self
{
if (!$this->politiqueDepartementales->contains($politiqueDepartementale)) {
$this->politiqueDepartementales[] = $politiqueDepartementale;
$politiqueDepartementale->addService($this);
}
return $this;
}
public function removePolitiqueDepartementale(PolitiqueDepartementale $politiqueDepartementale): self
{
if ($this->politiqueDepartementales->removeElement($politiqueDepartementale)) {
$politiqueDepartementale->removeService($this);
}
return $this;
}
public function getContent(): ?string
{
return $this->content;
}
public function setContent(?string $content): self
{
$this->content = $content;
return $this;
}
public function getNombreVisite(): ?int
{
return $this->nombre_visite;
}
public function setNombreVisite(?int $nombre_visite): self
{
$this->nombre_visite = $nombre_visite;
return $this;
}
public function getAvisPositif(): ?int
{
return $this->avis_positif;
}
public function setAvisPositif(?int $avis_positif): self
{
$this->avis_positif = $avis_positif;
return $this;
}
public function getAvisNegatif(): ?int
{
return $this->avis_negatif;
}
public function setAvisNegatif(?int $avis_negatif): self
{
$this->avis_negatif = $avis_negatif;
return $this;
}
public function __toString(): string
{
return (string) $this->titre;
}
public function getStatut(): ?Statut
{
return $this->statut;
}
public function setStatut(?Statut $statut): self
{
$this->statut = $statut;
return $this;
}
public function getDateUpdate(): ?\DateTimeInterface
{
return $this->date_update;
}
public function setDateUpdate(?\DateTimeInterface $date_update): self
{
$this->date_update = $date_update;
return $this;
}
public function getAliasUrl(): ?string
{
return $this->alias_url;
}
public function setAliasUrl(?string $alias_url): self
{
$this->alias_url = $alias_url;
return $this;
}
/**
* @return Collection|PageAccueilService[]
*/
public function getPageAccueilServices(): Collection
{
return $this->pageAccueilServices;
}
public function addPageAccueilService(PageAccueilService $pageAccueilService): self
{
if (!$this->pageAccueilServices->contains($pageAccueilService)) {
$this->pageAccueilServices[] = $pageAccueilService;
$pageAccueilService->addService($this);
}
return $this;
}
public function removePageAccueilService(PageAccueilService $pageAccueilService): self
{
if ($this->pageAccueilServices->removeElement($pageAccueilService)) {
$pageAccueilService->removeService($this);
}
return $this;
}
/**
* @return Collection|Epingle[]
*/
public function getEpingles(): Collection
{
return $this->epingles;
}
public function addEpingle(Epingle $epingle): self
{
if (!$this->epingles->contains($epingle)) {
$this->epingles[] = $epingle;
$epingle->addVisibleServicesEntity($this);
}
return $this;
}
public function removeEpingle(Epingle $epingle): self
{
if ($this->epingles->removeElement($epingle)) {
$epingle->removeVisibleServicesEntity($this);
}
return $this;
}
public function getOrderService(): ?int
{
return $this->order_service;
}
public function setOrderService(?int $order_service): self
{
$this->order_service = $order_service;
return $this;
}
public function getViewCount(): ?int
{
return $this->view_count;
}
public function setViewCount(?int $view_count): self
{
$this->view_count = $view_count;
return $this;
}
/**
* @return Collection<int, ServiceFeedback>
*/
public function getServiceFeedback(): Collection
{
return $this->serviceFeedback;
}
public function addServiceFeedback(ServiceFeedback $serviceFeedback): self
{
if (!$this->serviceFeedback->contains($serviceFeedback)) {
$this->serviceFeedback[] = $serviceFeedback;
$serviceFeedback->setService($this);
}
return $this;
}
public function removeServiceFeedback(ServiceFeedback $serviceFeedback): self
{
if ($this->serviceFeedback->removeElement($serviceFeedback)) {
// set the owning side to null (unless already changed)
if ($serviceFeedback->getService() === $this) {
$serviceFeedback->setService(null);
}
}
return $this;
}
/**
* @return Collection<int, PageSatellite>
*/
public function getPageSatellites(): Collection
{
return $this->pageSatellites;
}
public function addPageSatellite(PageSatellite $pageSatellite): self
{
if (!$this->pageSatellites->contains($pageSatellite)) {
$this->pageSatellites->add($pageSatellite);
$pageSatellite->addService($this);
}
return $this;
}
public function removePageSatellite(PageSatellite $pageSatellite): self
{
if ($this->pageSatellites->removeElement($pageSatellite)) {
$pageSatellite->removeService($this);
}
return $this;
}
}