<?php
namespace App\Entity;
use App\Repository\UserStatusInternRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=UserStatusInternRepository::class)
*/
class UserStatusIntern
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\Column(type="boolean")
*/
private $visibleInApp;
/**
* @ORM\OneToMany(targetEntity=Users::class, mappedBy="statusIntern")
*/
private $users;
public function __construct()
{
$this->users = 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 isVisibleInApp(): ?bool
{
return $this->visibleInApp;
}
public function setVisibleInApp(bool $visibleInApp): self
{
$this->visibleInApp = $visibleInApp;
return $this;
}
/**
* @return Collection<int, Users>
*/
public function getUsers(): Collection
{
return $this->users;
}
public function addUser(Users $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
$user->setStatusIntern($this);
}
return $this;
}
public function removeUser(Users $user): self
{
if ($this->users->removeElement($user)) {
// set the owning side to null (unless already changed)
if ($user->getStatusIntern() === $this) {
$user->setStatusIntern(null);
}
}
return $this;
}
}