src/Entity/UserStatus.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\UserStatusRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=UserStatusRepository::class)
  9.  */
  10. class UserStatus
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=255)
  24.      */
  25.     private $devName;
  26.     /**
  27.      * @ORM\Column(type="integer")
  28.      */
  29.     private $idPerso;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=UserEstablishment::class, mappedBy="status")
  32.      */
  33.     private $userEstablishments;
  34.     /**
  35.      * @ORM\Column(type="boolean")
  36.      */
  37.     private $visibleInApp;
  38.     public function __construct()
  39.     {
  40.         $this->userEstablishments = new ArrayCollection();
  41.     }
  42.     public function getId(): ?int
  43.     {
  44.         return $this->id;
  45.     }
  46.     public function getName(): ?string
  47.     {
  48.         return $this->name;
  49.     }
  50.     public function setName(string $name): self
  51.     {
  52.         $this->name $name;
  53.         return $this;
  54.     }
  55.     public function getDevName(): ?string
  56.     {
  57.         return $this->devName;
  58.     }
  59.     public function setDevName(string $devName): self
  60.     {
  61.         $this->devName $devName;
  62.         return $this;
  63.     }
  64.     public function getIdPerso(): ?int
  65.     {
  66.         return $this->idPerso;
  67.     }
  68.     public function setIdPerso(int $idPerso): self
  69.     {
  70.         $this->idPerso $idPerso;
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection<int, UserEstablishment>
  75.      */
  76.     public function getUserEstablishments(): Collection
  77.     {
  78.         return $this->userEstablishments;
  79.     }
  80.     public function addUserEstablishment(UserEstablishment $userEstablishment): self
  81.     {
  82.         if (!$this->userEstablishments->contains($userEstablishment)) {
  83.             $this->userEstablishments[] = $userEstablishment;
  84.             $userEstablishment->setStatus($this);
  85.         }
  86.         return $this;
  87.     }
  88.     public function removeUserEstablishment(UserEstablishment $userEstablishment): self
  89.     {
  90.         if ($this->userEstablishments->removeElement($userEstablishment)) {
  91.             // set the owning side to null (unless already changed)
  92.             if ($userEstablishment->getStatus() === $this) {
  93.                 $userEstablishment->setStatus(null);
  94.             }
  95.         }
  96.         return $this;
  97.     }
  98.     public function isVisibleInApp(): ?bool
  99.     {
  100.         return $this->visibleInApp;
  101.     }
  102.     public function setVisibleInApp(bool $visibleInApp): self
  103.     {
  104.         $this->visibleInApp $visibleInApp;
  105.         return $this;
  106.     }
  107. }