src/Entity/Adherent/Service.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Adherent;
  3. use App\Entity\SiteWeb\PageSitewebServices;
  4. use App\Entity\Webfactory\Opc\OpcService;
  5. use App\Entity\Webfactory\Widget\SiteWebService;
  6. use App\Repository\Adherent\ServiceRepository;
  7. use Doctrine\Common\Collections\ArrayCollection;
  8. use Doctrine\Common\Collections\Collection;
  9. use Doctrine\ORM\Mapping as ORM;
  10. #[ORM\Entity(repositoryClassServiceRepository::class)]
  11. class Service 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\ManyToOne(targetEntityTypeService::class, inversedBy'services')]
  20.     private $type;
  21.     #[ORM\ManyToMany(targetEntityMagasin::class, mappedBy'services')]
  22.     private $magasins;
  23.     #[ORM\Column(type'string'length255nullabletrue)]
  24.     private $svg;
  25.     #[ORM\OneToMany(targetEntityOpcService::class, mappedBy'idService')]
  26.     private $opcServices;
  27.     #[ORM\OneToMany(targetEntitySiteWebService::class, mappedBy'idService')]
  28.     private $sitewebServices;
  29.     #[ORM\Column(type'boolean'nullablefalse)]
  30.     private $showableInBe;
  31.     #[ORM\Column(type'string'length255nullabletrue)]
  32.     private $progressIdentifier;
  33.     public function __construct()
  34.     {
  35.         $this->magasins = new ArrayCollection();
  36.         $this->opcServices = new ArrayCollection();
  37.         $this->sitewebServices = new ArrayCollection();
  38.         $this->showableInBe true;
  39.     }
  40.     public function __toString(): string{
  41.         return (string) $this->name;
  42.     }
  43.     public function getId(): ?int
  44.     {
  45.         return $this->id;
  46.     }
  47.     public function getName(): ?string
  48.     {
  49.         return $this->name;
  50.     }
  51.     public function setName(string $name): self
  52.     {
  53.         $this->name $name;
  54.         return $this;
  55.     }
  56.     public function getType(): ?TypeService
  57.     {
  58.         return $this->type;
  59.     }
  60.     public function setType(?TypeService $type): self
  61.     {
  62.         $this->type $type;
  63.         return $this;
  64.     }
  65.     /**
  66.      * @return Collection|Magasin[]
  67.      */
  68.     public function getMagasins(): Collection
  69.     {
  70.         return $this->magasins;
  71.     }
  72.     public function addMagasin(Magasin $magasin): self
  73.     {
  74.         if (!$this->magasins->contains($magasin)) {
  75.             $this->magasins[] = $magasin;
  76.             $magasin->addService($this);
  77.         }
  78.         return $this;
  79.     }
  80.     public function removeMagasin(Magasin $magasin): self
  81.     {
  82.         if ($this->magasins->removeElement($magasin)) {
  83.             $magasin->removeService($this);
  84.         }
  85.         return $this;
  86.     }
  87.     public function getSvg(): ?string
  88.     {
  89.         return $this->svg;
  90.     }
  91.     public function setSvg(?string $svg): self
  92.     {
  93.         $this->svg $svg;
  94.         return $this;
  95.     }
  96.     /**
  97.      * @return Collection<int, OpcService>
  98.      */
  99.     public function getOpcServices(): Collection
  100.     {
  101.         return $this->opcServices;
  102.     }
  103.     public function addOpcService(OpcService $opcService): self
  104.     {
  105.         if (!$this->opcServices->contains($opcService)) {
  106.             $this->opcServices[] = $opcService;
  107.             $opcService->setIdService($this);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removeOpcService(OpcService $opcService): self
  112.     {
  113.         if ($this->opcServices->removeElement($opcService)) {
  114.             // set the owning side to null (unless already changed)
  115.             if ($opcService->getIdService() === $this) {
  116.                 $opcService->setIdService(null);
  117.             }
  118.         }
  119.         return $this;
  120.     }
  121.     /**
  122.      * @return Collection<int, SiteWebService>
  123.      */
  124.     public function getSitewebServices(): Collection
  125.     {
  126.         return $this->sitewebServices;
  127.     }
  128.     public function addSitewebServices(SiteWebService $sitewebServices): self
  129.     {
  130.         if (!$this->sitewebServices->contains($sitewebServices)) {
  131.             $this->sitewebServices[] = $sitewebServices;
  132.             $sitewebServices->setIdService($this);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeSitewebServices(SiteWebService $sitewebServices): self
  137.     {
  138.         if ($this->sitewebServices->removeElement($sitewebServices)) {
  139.             // set the owning side to null (unless already changed)
  140.             if ($sitewebServices->getIdService() === $this) {
  141.                 $sitewebServices->setIdService(null);
  142.             }
  143.         }
  144.         return $this;
  145.     }
  146.     /**
  147.      * @return mixed
  148.      */
  149.     public function getShowableInBe()
  150.     {
  151.         return $this->showableInBe;
  152.     }
  153.     /**
  154.      * @param mixed $showableInBe
  155.      */
  156.     public function setShowableInBe($showableInBe): void
  157.     {
  158.         $this->showableInBe $showableInBe;
  159.     }
  160.     /**
  161.      * @return string|null
  162.      */
  163.     public function getProgressIdentifier(): ?string
  164.     {
  165.         return $this->progressIdentifier;
  166.     }
  167.     /**
  168.      * @param mixed $progressIdentifier
  169.      */
  170.     public function setProgressIdentifier(?string $progressIdentifier): void
  171.     {
  172.         $this->progressIdentifier $progressIdentifier;
  173.     }
  174. }