<?php
namespace App\Entity;
use App\Repository\ProfilRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* Profil
*
* @ORM\Table(name="ref_profil")
* @ORM\Entity(repositoryClass=ProfilRepository::class)
* @Gedmo\Loggable
*/
class Profil
{
/**
* @var int
*
* @ORM\Column(name="profil_id", type="integer", nullable=false)
* @ORM\Id
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $profilId;
/**
* @var string
*
* @ORM\Column(name="profil_lib", type="string", length=255, nullable=false)
* @Gedmo\Versioned
*/
private $profilLib;
/**
* @var string
*
* @ORM\Column(name="profil_sf", type="string", length=255, nullable=false)
* @Gedmo\Versioned
*/
private $profilSf;
/**
* @ORM\ManyToMany(targetEntity="User", mappedBy="profil")
*/
private $user;
public function __construct()
{
$this->user = new ArrayCollection();
}
public function getProfilId(): ?int
{
return $this->profilId;
}
public function getProfilLib(): ?string
{
return $this->profilLib;
}
public function setProfilLib(string $profilLib): self
{
$this->profilLib = $profilLib;
return $this;
}
public function getProfilSf(): ?string
{
return $this->profilSf;
}
public function setProfilSf(string $profilSf): self
{
$this->profilSf = $profilSf;
return $this;
}
public function __toString()
{
return $this->profilSf;
}
/**
* @return Collection<int, User>
*/
public function getUser(): Collection
{
return $this->user;
}
public function addUser(User $user): self
{
if (!$this->user->contains($user)) {
$this->user[] = $user;
$user->addProfil($this);
}
return $this;
}
public function removeUser(User $user): self
{
if ($this->user->removeElement($user)) {
$user->removeProfil($this);
}
return $this;
}
}