src/Entity/Adherent/Specialite.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Adherent;
  3. use App\Entity\SiteWeb\PageSiteWebSpecialites;
  4. use App\Entity\Webfactory\Opc\OpcSpecialite;
  5. use App\Entity\Webfactory\Widget\SiteWebSpecialite;
  6. use App\Repository\Adherent\SpecialiteRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. #[ORM\Entity(repositoryClassSpecialiteRepository::class)]
  11. class Specialite implements \Stringable
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column(type'integer')]
  16.     private $id;
  17.     #[ORM\Column(type'string'length255)]
  18.     private $name;
  19.     #[ORM\ManyToMany(targetEntityMagasin::class, mappedBy'specialites')]
  20.     private $magasins;
  21.     #[ORM\Column(type'string'length255nullabletrue)]
  22.     private $svg;
  23.     #[ORM\OneToMany(targetEntityOpcSpecialite::class, mappedBy'idSpecialite')]
  24.     private $opcSpecialites;
  25.     #[ORM\OneToMany(targetEntitySiteWebSpecialite::class, mappedBy'idSpecialite')]
  26.     private $siteWebSpecialites;
  27.     #[ORM\Column(type'string'length255nullabletrue)]
  28.     private $progressIdentifier;
  29.     public function __construct()
  30.     {
  31.         $this->magasin = new ArrayCollection();
  32.         $this->magasins = new ArrayCollection();
  33.         $this->opcSpecialites = new ArrayCollection();
  34.         $this->siteWebSpecialites = new ArrayCollection();
  35.     }
  36.     public function __toString(): string{
  37.         return (string) $this->name;
  38.     }
  39.     public function getId(): ?int
  40.     {
  41.         return $this->id;
  42.     }
  43.     public function getName(): ?string
  44.     {
  45.         return $this->name;
  46.     }
  47.     public function setName(string $name): self
  48.     {
  49.         $this->name $name;
  50.         return $this;
  51.     }
  52.     /**
  53.      * @return Collection|Magasin[]
  54.      */
  55.     public function getMagasins(): Collection
  56.     {
  57.         return $this->magasins;
  58.     }
  59.     public function addMagasin(Magasin $magasin): self
  60.     {
  61.         if (!$this->magasins->contains($magasin)) {
  62.             $this->magasins[] = $magasin;
  63.             $magasin->addSpecialite($this);
  64.         }
  65.         return $this;
  66.     }
  67.     public function removeMagasin(Magasin $magasin): self
  68.     {
  69.         if ($this->magasins->removeElement($magasin)) {
  70.             $magasin->removeSpecialite($this);
  71.         }
  72.         return $this;
  73.     }
  74.     public function getSvg(): ?string
  75.     {
  76.         return $this->svg;
  77.     }
  78.     public function setSvg(?string $svg): self
  79.     {
  80.         $this->svg $svg;
  81.         return $this;
  82.     }
  83.     /**
  84.      * @return Collection<int, OpcSpecialite>
  85.      */
  86.     public function getOpcSpecialites(): Collection
  87.     {
  88.         return $this->opcSpecialites;
  89.     }
  90.     public function addOpcSpecialite(OpcSpecialite $opcSspecialite): self
  91.     {
  92.         if (!$this->opcSpecialites->contains($opcSspecialite)) {
  93.             $this->opcSpecialites[] = $opcSspecialite;
  94.             $opcSspecialite->setIdSpecialite($this);
  95.         }
  96.         return $this;
  97.     }
  98.     public function removeOpcSpecialite(OpcSpecialite $opcSpecialite): self
  99.     {
  100.         if ($this->opcSpecialites->removeElement($opcSpecialite)) {
  101.             // set the owning side to null (unless already changed)
  102.             if ($opcSpecialite->getIdSpecialite() === $this) {
  103.                 $opcSpecialite->setIdSpecialite(null);
  104.             }
  105.         }
  106.         return $this;
  107.     }
  108.     /**
  109.      * @return Collection<int, SiteWebSpecialites>
  110.      */
  111.     public function getSiteWebSpecialites(): Collection
  112.     {
  113.         return $this->siteWebSpecialites;
  114.     }
  115.     public function addSiteWebSpecialites(SiteWebSpecialite $siteWebSpecialites): self
  116.     {
  117.         if (!$this->siteWebSpecialites->contains($siteWebSpecialites)) {
  118.             $this->siteWebSpecialites[] = $siteWebSpecialites;
  119.             $siteWebSpecialites->setIdSpecialite($this);
  120.         }
  121.         return $this;
  122.     }
  123.     public function removeSiteWebSpecialites(SiteWebSpecialite $siteWebSpecialites): self
  124.     {
  125.         if ($this->siteWebSpecialites->removeElement($siteWebSpecialites)) {
  126.             // set the owning side to null (unless already changed)
  127.             if ($siteWebSpecialites->getIdSpecialite() === $this) {
  128.                 $siteWebSpecialites->setIdSpecialite(null);
  129.             }
  130.         }
  131.         return $this;
  132.     }
  133.     /**
  134.      * @return string|null
  135.      */
  136.     public function getProgressIdentifier(): ?string
  137.     {
  138.         return $this->progressIdentifier;
  139.     }
  140.     /**
  141.      * @param mixed $progressIdentifier
  142.      */
  143.     public function setProgressIdentifier(?string $progressIdentifier): void
  144.     {
  145.         $this->progressIdentifier $progressIdentifier;
  146.     }
  147. }