<?php
namespace App\Entity\Adherent;
use App\Entity\SiteWeb\PageSiteWebSpecialites;
use App\Entity\Webfactory\Opc\OpcSpecialite;
use App\Entity\Webfactory\Widget\SiteWebSpecialite;
use App\Repository\Adherent\SpecialiteRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: SpecialiteRepository::class)]
class Specialite implements \Stringable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $name;
#[ORM\ManyToMany(targetEntity: Magasin::class, mappedBy: 'specialites')]
private $magasins;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $svg;
#[ORM\OneToMany(targetEntity: OpcSpecialite::class, mappedBy: 'idSpecialite')]
private $opcSpecialites;
#[ORM\OneToMany(targetEntity: SiteWebSpecialite::class, mappedBy: 'idSpecialite')]
private $siteWebSpecialites;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $progressIdentifier;
public function __construct()
{
$this->magasin = new ArrayCollection();
$this->magasins = new ArrayCollection();
$this->opcSpecialites = new ArrayCollection();
$this->siteWebSpecialites = new ArrayCollection();
}
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;
}
/**
* @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->addSpecialite($this);
}
return $this;
}
public function removeMagasin(Magasin $magasin): self
{
if ($this->magasins->removeElement($magasin)) {
$magasin->removeSpecialite($this);
}
return $this;
}
public function getSvg(): ?string
{
return $this->svg;
}
public function setSvg(?string $svg): self
{
$this->svg = $svg;
return $this;
}
/**
* @return Collection<int, OpcSpecialite>
*/
public function getOpcSpecialites(): Collection
{
return $this->opcSpecialites;
}
public function addOpcSpecialite(OpcSpecialite $opcSspecialite): self
{
if (!$this->opcSpecialites->contains($opcSspecialite)) {
$this->opcSpecialites[] = $opcSspecialite;
$opcSspecialite->setIdSpecialite($this);
}
return $this;
}
public function removeOpcSpecialite(OpcSpecialite $opcSpecialite): self
{
if ($this->opcSpecialites->removeElement($opcSpecialite)) {
// set the owning side to null (unless already changed)
if ($opcSpecialite->getIdSpecialite() === $this) {
$opcSpecialite->setIdSpecialite(null);
}
}
return $this;
}
/**
* @return Collection<int, SiteWebSpecialites>
*/
public function getSiteWebSpecialites(): Collection
{
return $this->siteWebSpecialites;
}
public function addSiteWebSpecialites(SiteWebSpecialite $siteWebSpecialites): self
{
if (!$this->siteWebSpecialites->contains($siteWebSpecialites)) {
$this->siteWebSpecialites[] = $siteWebSpecialites;
$siteWebSpecialites->setIdSpecialite($this);
}
return $this;
}
public function removeSiteWebSpecialites(SiteWebSpecialite $siteWebSpecialites): self
{
if ($this->siteWebSpecialites->removeElement($siteWebSpecialites)) {
// set the owning side to null (unless already changed)
if ($siteWebSpecialites->getIdSpecialite() === $this) {
$siteWebSpecialites->setIdSpecialite(null);
}
}
return $this;
}
/**
* @return string|null
*/
public function getProgressIdentifier(): ?string
{
return $this->progressIdentifier;
}
/**
* @param mixed $progressIdentifier
*/
public function setProgressIdentifier(?string $progressIdentifier): void
{
$this->progressIdentifier = $progressIdentifier;
}
}