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