<?php
namespace App\Entity\Adherent;
use App\Entity\SiteWeb\PageSitewebServices;
use App\Entity\Webfactory\Opc\OpcService;
use App\Entity\Webfactory\Widget\SiteWebService;
use App\Repository\Adherent\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 $id;
#[ORM\Column(type: 'string', length: 255)]
private $name;
#[ORM\ManyToOne(targetEntity: TypeService::class, inversedBy: 'services')]
private $type;
#[ORM\ManyToMany(targetEntity: Magasin::class, mappedBy: 'services')]
private $magasins;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $svg;
#[ORM\OneToMany(targetEntity: OpcService::class, mappedBy: 'idService')]
private $opcServices;
#[ORM\OneToMany(targetEntity: SiteWebService::class, mappedBy: 'idService')]
private $sitewebServices;
#[ORM\Column(type: 'boolean', nullable: false)]
private $showableInBe;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $progressIdentifier;
public function __construct()
{
$this->magasins = new ArrayCollection();
$this->opcServices = new ArrayCollection();
$this->sitewebServices = new ArrayCollection();
$this->showableInBe = true;
}
public function __toString(): string{
return (string) $this->name;
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getType(): ?TypeService
{
return $this->type;
}
public function setType(?TypeService $type): self
{
$this->type = $type;
return $this;
}
/**
* @return Collection|Magasin[]
*/
public function getMagasins(): Collection
{
return $this->magasins;
}
public function addMagasin(Magasin $magasin): self
{
if (!$this->magasins->contains($magasin)) {
$this->magasins[] = $magasin;
$magasin->addService($this);
}
return $this;
}
public function removeMagasin(Magasin $magasin): self
{
if ($this->magasins->removeElement($magasin)) {
$magasin->removeService($this);
}
return $this;
}
public function getSvg(): ?string
{
return $this->svg;
}
public function setSvg(?string $svg): self
{
$this->svg = $svg;
return $this;
}
/**
* @return Collection<int, OpcService>
*/
public function getOpcServices(): Collection
{
return $this->opcServices;
}
public function addOpcService(OpcService $opcService): self
{
if (!$this->opcServices->contains($opcService)) {
$this->opcServices[] = $opcService;
$opcService->setIdService($this);
}
return $this;
}
public function removeOpcService(OpcService $opcService): self
{
if ($this->opcServices->removeElement($opcService)) {
// set the owning side to null (unless already changed)
if ($opcService->getIdService() === $this) {
$opcService->setIdService(null);
}
}
return $this;
}
/**
* @return Collection<int, SiteWebService>
*/
public function getSitewebServices(): Collection
{
return $this->sitewebServices;
}
public function addSitewebServices(SiteWebService $sitewebServices): self
{
if (!$this->sitewebServices->contains($sitewebServices)) {
$this->sitewebServices[] = $sitewebServices;
$sitewebServices->setIdService($this);
}
return $this;
}
public function removeSitewebServices(SiteWebService $sitewebServices): self
{
if ($this->sitewebServices->removeElement($sitewebServices)) {
// set the owning side to null (unless already changed)
if ($sitewebServices->getIdService() === $this) {
$sitewebServices->setIdService(null);
}
}
return $this;
}
/**
* @return mixed
*/
public function getShowableInBe()
{
return $this->showableInBe;
}
/**
* @param mixed $showableInBe
*/
public function setShowableInBe($showableInBe): void
{
$this->showableInBe = $showableInBe;
}
/**
* @return string|null
*/
public function getProgressIdentifier(): ?string
{
return $this->progressIdentifier;
}
/**
* @param mixed $progressIdentifier
*/
public function setProgressIdentifier(?string $progressIdentifier): void
{
$this->progressIdentifier = $progressIdentifier;
}
}