src/Entity/Gestiform/Admin/Salle.php line 17

  1. <?php
  2. namespace App\Entity\Gestiform\Admin;
  3. use App\Entity\AbstractEntity;
  4. use App\Entity\Gestiform\Admin\MasterListe\Masterlistelg;
  5. use App\Entity\Gestiform\Formations\Reunion\Reunion;
  6. use App\Entity\Gestiform\Formations\Session\SalleEvent;
  7. use App\Repository\Gestiform\Admin\SalleRepository;
  8. use Doctrine\Common\Collections\ArrayCollection;
  9. use Doctrine\Common\Collections\Collection;
  10. use Doctrine\ORM\Mapping as ORM;
  11. #[ORM\Entity(repositoryClassSalleRepository::class)]
  12. class Salle extends AbstractEntity
  13. {
  14.     #[ORM\Column(type'string'length255nullablefalse)]
  15.     private string $intitule;
  16.     #[ORM\Column(type'integer'nullabletrue)]
  17.     private ?int $capacite null;
  18.     #[ORM\JoinColumn(nullabletrue)]
  19.     #[ORM\ManyToOne(targetEntityMasterlistelg::class)]
  20.     private ?Masterlistelg $niveauMateriel null;
  21.     #[ORM\Column(type'string'length255nullabletrue)]
  22.     private ?string $uservituelid;
  23.     #[ORM\Column(type'string'length255nullabletrue)]
  24.     private ?string $sallevirtuelleid;
  25.     #[ORM\Column(type'string'length255nullabletrue)]
  26.     private ?string $logocouleur null;
  27.     #[ORM\Column(type'string'length255nullabletrue)]
  28.     private ?string $lienvirtuel;
  29.     #[ORM\Column(type'boolean'nullabletrue)]
  30.     private bool $reservee false;
  31.     #[ORM\JoinColumn(nullabletrue)]
  32.     #[ORM\ManyToOne(targetEntitySite::class, inversedBy'salles')]
  33.     private ?Site $site null;
  34.     #[ORM\Column(type'boolean'nullabletrue)]
  35.     private ?bool $virtuel null;
  36.     #[ORM\OneToMany(mappedBy'salle'targetEntityReunion::class, cascade: ['persist'])]
  37.     private Collection $reunions;
  38.     #[ORM\OneToMany(mappedBy'event'targetEntitySalleEvent::class, cascade: ['persist''remove'])]
  39.     private Collection $salleEvents;
  40.     public function __construct()
  41.     {
  42.         $this->reunions = new ArrayCollection();
  43.         $this->salleEvents = new ArrayCollection();
  44.     }
  45.     public function getIntitule(): ?string
  46.     {
  47.         return $this->intitule;
  48.     }
  49.     public function setIntitule(string $intitule): self
  50.     {
  51.         $this->intitule $intitule;
  52.         return $this;
  53.     }
  54.     public function getLogocouleur(): ?string
  55.     {
  56.         return $this->logocouleur;
  57.     }
  58.     public function setLogocouleur(?string $logocouleur): self
  59.     {
  60.         $this->logocouleur $logocouleur;
  61.         return $this;
  62.     }
  63.     public function getCapacite(): ?int
  64.     {
  65.         return $this->capacite;
  66.     }
  67.     public function setCapacite(?int $capacite): self
  68.     {
  69.         $this->capacite $capacite;
  70.         return $this;
  71.     }
  72.     public function getNiveauMateriel(): ?Masterlistelg
  73.     {
  74.         return $this->niveauMateriel;
  75.     }
  76.     public function setNiveauMateriel(?Masterlistelg $niveauMateriel): self
  77.     {
  78.         $this->niveauMateriel $niveauMateriel;
  79.         return $this;
  80.     }
  81.     public function getUservituelid(): ?string
  82.     {
  83.         return $this->uservituelid;
  84.     }
  85.     public function setUservituelid(?string $uservituelid): self
  86.     {
  87.         $this->uservituelid $uservituelid;
  88.         return $this;
  89.     }
  90.     public function getSallevirtuelleid(): ?string
  91.     {
  92.         return $this->sallevirtuelleid;
  93.     }
  94.     public function setSallevirtuelleid(?string $sallevirtuelleid): self
  95.     {
  96.         $this->sallevirtuelleid $sallevirtuelleid;
  97.         return $this;
  98.     }
  99.     public function getLienvirtuel(): ?string
  100.     {
  101.         return $this->lienvirtuel;
  102.     }
  103.     public function setLienvirtuel(?string $lienvirtuel): self
  104.     {
  105.         $this->lienvirtuel $lienvirtuel;
  106.         return $this;
  107.     }
  108.     public function isReservee(): ?bool
  109.     {
  110.         return $this->reservee;
  111.     }
  112.     public function setReservee(?bool $reservee): self
  113.     {
  114.         $this->reservee $reservee;
  115.         return $this;
  116.     }
  117.     public function getSite(): ?Site
  118.     {
  119.         return $this->site;
  120.     }
  121.     public function setSite(?Site $site): self
  122.     {
  123.         $this->site $site;
  124.         return $this;
  125.     }
  126.     /**
  127.      * @return Collection<int, Reunion>
  128.      */
  129.     public function getReunions(): Collection
  130.     {
  131.         return $this->reunions;
  132.     }
  133.     public function addReunion(Reunion $reunion): self
  134.     {
  135.         if (!$this->reunions->contains($reunion)) {
  136.             $this->reunions->add($reunion);
  137.             $reunion->setSalle($this);
  138.         }
  139.         return $this;
  140.     }
  141.     public function removeReunion(Reunion $reunion): self
  142.     {
  143.         // set the owning side to null (unless already changed)
  144.         if ($this->reunions->removeElement($reunion) && $reunion->getSalle() === $this) {
  145.             $reunion->setSalle(null);
  146.         }
  147.         return $this;
  148.     }
  149.     public function getSallesEvents(): Collection
  150.     {
  151.         return $this->salleEvents;
  152.     }
  153.     public function addSalleEvent(SalleEvent $salleEvent): self
  154.     {
  155.         if (!$this->salleEvents->contains($salleEvent)) {
  156.             $this->salleEvents->add($salleEvent);
  157.             $salleEvent->setSalle($this);
  158.         }
  159.         return $this;
  160.     }
  161.     public function removeSalleEvent(SalleEvent $salleEvent): self
  162.     {
  163.         // set the owning side to null (unless already changed)
  164.         if ($this->salleEvents->removeElement($salleEvent) && $salleEvent->getSalle() === $this) {
  165.             $salleEvent->setSalle(null);
  166.         }
  167.         return $this;
  168.     }
  169.         public function getLieu(): ?string
  170.     {   
  171.         if (!is_null($this->getSite())) {
  172.             return $this->getSite()?->getAdresse()?->getAdresse()?->getFullDesignation();
  173.         }
  174.         return $this->getLienvirtuel();
  175.     }
  176.     public function isVirtuel(): ?bool
  177.     {
  178.         return $this->virtuel;
  179.     }
  180.     public function setVirtuel(?bool $virtuel): self
  181.     {
  182.         $this->virtuel $virtuel;
  183.         return $this;
  184.     }
  185. }