<?php
namespace App\Entity;
use App\Repository\UserStatusRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=UserStatusRepository::class)
*/
class UserStatus
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="string", length=255)
*/
private $devName;
/**
* @ORM\Column(type="integer")
*/
private $idPerso;
/**
* @ORM\OneToMany(targetEntity=UserEstablishment::class, mappedBy="status")
*/
private $userEstablishments;
/**
* @ORM\Column(type="boolean")
*/
private $visibleInApp;
public function __construct()
{
$this->userEstablishments = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getDevName(): ?string
{
return $this->devName;
}
public function setDevName(string $devName): self
{
$this->devName = $devName;
return $this;
}
public function getIdPerso(): ?int
{
return $this->idPerso;
}
public function setIdPerso(int $idPerso): self
{
$this->idPerso = $idPerso;
return $this;
}
/**
* @return Collection<int, UserEstablishment>
*/
public function getUserEstablishments(): Collection
{
return $this->userEstablishments;
}
public function addUserEstablishment(UserEstablishment $userEstablishment): self
{
if (!$this->userEstablishments->contains($userEstablishment)) {
$this->userEstablishments[] = $userEstablishment;
$userEstablishment->setStatus($this);
}
return $this;
}
public function removeUserEstablishment(UserEstablishment $userEstablishment): self
{
if ($this->userEstablishments->removeElement($userEstablishment)) {
// set the owning side to null (unless already changed)
if ($userEstablishment->getStatus() === $this) {
$userEstablishment->setStatus(null);
}
}
return $this;
}
public function isVisibleInApp(): ?bool
{
return $this->visibleInApp;
}
public function setVisibleInApp(bool $visibleInApp): self
{
$this->visibleInApp = $visibleInApp;
return $this;
}
}