293 lines
6.4 KiB
PHP
293 lines
6.4 KiB
PHP
|
<?php
|
||
|
namespace App\Entity;
|
||
|
|
||
|
use Doctrine\Common\Collections\Collection;
|
||
|
use Doctrine\DBAL\Types\Types;
|
||
|
use Doctrine\ORM\Mapping as ORM;
|
||
|
use Doctrine\Common\Collections\ArrayCollection;
|
||
|
|
||
|
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||
|
use App\Validator as Validator;
|
||
|
|
||
|
/**
|
||
|
* @ORM\Entity
|
||
|
* @ORM\Table(name="niveau01")
|
||
|
* @ORM\HasLifecycleCallbacks()
|
||
|
* @ORM\Entity(repositoryClass="App\Repository\Niveau01Repository")
|
||
|
*
|
||
|
* @UniqueEntity(fields="label", message="Un Niveau de rang 01 existe déjà avec ce label")
|
||
|
*/
|
||
|
class Niveau01
|
||
|
{
|
||
|
/**
|
||
|
* @ORM\Column(type="integer")
|
||
|
* @ORM\Id
|
||
|
* @ORM\GeneratedValue(strategy="AUTO")
|
||
|
*/
|
||
|
private $id;
|
||
|
|
||
|
/**
|
||
|
* @ORM\Column(type="string", length=250, unique=true)
|
||
|
* @Validator\Grouplabel()
|
||
|
* @Validator\Niveau01unique()
|
||
|
*/
|
||
|
private $label;
|
||
|
|
||
|
/**
|
||
|
* @ORM\Column(type="string")
|
||
|
*/
|
||
|
private $apikey;
|
||
|
|
||
|
/**
|
||
|
* @ORM\Column(type="text", nullable=true)
|
||
|
*/
|
||
|
private $ldapfilter;
|
||
|
|
||
|
/**
|
||
|
* @ORM\Column(type="text", nullable=true)
|
||
|
*/
|
||
|
private $attributes;
|
||
|
|
||
|
/**
|
||
|
* @ORM\Column(type="text", nullable=true)
|
||
|
*/
|
||
|
private $idexternal;
|
||
|
|
||
|
/**
|
||
|
* @var ArrayCollection $niveau02s
|
||
|
* @var Registration
|
||
|
*
|
||
|
* @ORM\OneToMany(targetEntity="Niveau02", mappedBy="niveau01", cascade={"persist"}, orphanRemoval=false)
|
||
|
*/
|
||
|
private $niveau02s;
|
||
|
|
||
|
/**
|
||
|
* @var ArrayCollection $registrations
|
||
|
* @var Registration
|
||
|
*
|
||
|
* @ORM\OneToMany(targetEntity="Registration", mappedBy="niveau01", cascade={"persist"}, orphanRemoval=false)
|
||
|
*/
|
||
|
private $registrations;
|
||
|
|
||
|
/**
|
||
|
* @var ArrayCollection $users
|
||
|
* @var User
|
||
|
*
|
||
|
* @ORM\OneToMany(targetEntity="User", mappedBy="niveau01", cascade={"persist"}, orphanRemoval=false)
|
||
|
*/
|
||
|
private $users;
|
||
|
|
||
|
|
||
|
/**
|
||
|
* @var ArrayCollection $modos
|
||
|
* @var User
|
||
|
*
|
||
|
* @ORM\OneToMany(targetEntity="UserModo", mappedBy="niveau01", cascade={"persist"}, orphanRemoval=false)
|
||
|
*/
|
||
|
private $modos;
|
||
|
|
||
|
public function __construct()
|
||
|
{
|
||
|
$this->niveau02s = new ArrayCollection();
|
||
|
$this->registrations = new ArrayCollection();
|
||
|
$this->users = new ArrayCollection();
|
||
|
$this->modos = new ArrayCollection();
|
||
|
}
|
||
|
|
||
|
|
||
|
//== CODE A NE PAS REGENERER
|
||
|
public function setId(int $id): self
|
||
|
{
|
||
|
$this->id = $id;
|
||
|
return $this;
|
||
|
}
|
||
|
//== FIN DU CODE A NE PAS REGENERER
|
||
|
|
||
|
public function getId(): ?int
|
||
|
{
|
||
|
return $this->id;
|
||
|
}
|
||
|
|
||
|
public function getLabel(): ?string
|
||
|
{
|
||
|
return $this->label;
|
||
|
}
|
||
|
|
||
|
public function setLabel(string $label): self
|
||
|
{
|
||
|
$this->label = $label;
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function getApikey(): ?string
|
||
|
{
|
||
|
return $this->apikey;
|
||
|
}
|
||
|
|
||
|
public function setApikey(string $apikey): self
|
||
|
{
|
||
|
$this->apikey = $apikey;
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function getLdapfilter(): ?string
|
||
|
{
|
||
|
return $this->ldapfilter;
|
||
|
}
|
||
|
|
||
|
public function setLdapfilter(?string $ldapfilter): self
|
||
|
{
|
||
|
$this->ldapfilter = $ldapfilter;
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function getAttributes(): ?string
|
||
|
{
|
||
|
return $this->attributes;
|
||
|
}
|
||
|
|
||
|
public function setAttributes(?string $attributes): self
|
||
|
{
|
||
|
$this->attributes = $attributes;
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function getIdexternal(): ?string
|
||
|
{
|
||
|
return $this->idexternal;
|
||
|
}
|
||
|
|
||
|
public function setIdexternal(?string $idexternal): self
|
||
|
{
|
||
|
$this->idexternal = $idexternal;
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return Collection<int, Niveau02>
|
||
|
*/
|
||
|
public function getNiveau02s(): Collection
|
||
|
{
|
||
|
return $this->niveau02s;
|
||
|
}
|
||
|
|
||
|
public function addNiveau02(Niveau02 $niveau02): self
|
||
|
{
|
||
|
if (!$this->niveau02s->contains($niveau02)) {
|
||
|
$this->niveau02s[] = $niveau02;
|
||
|
$niveau02->setNiveau01($this);
|
||
|
}
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function removeNiveau02(Niveau02 $niveau02): self
|
||
|
{
|
||
|
if ($this->niveau02s->removeElement($niveau02)) {
|
||
|
// set the owning side to null (unless already changed)
|
||
|
if ($niveau02->getNiveau01() === $this) {
|
||
|
$niveau02->setNiveau01(null);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return Collection<int, Registration>
|
||
|
*/
|
||
|
public function getRegistrations(): Collection
|
||
|
{
|
||
|
return $this->registrations;
|
||
|
}
|
||
|
|
||
|
public function addRegistration(Registration $registration): self
|
||
|
{
|
||
|
if (!$this->registrations->contains($registration)) {
|
||
|
$this->registrations[] = $registration;
|
||
|
$registration->setNiveau01($this);
|
||
|
}
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function removeRegistration(Registration $registration): self
|
||
|
{
|
||
|
if ($this->registrations->removeElement($registration)) {
|
||
|
// set the owning side to null (unless already changed)
|
||
|
if ($registration->getNiveau01() === $this) {
|
||
|
$registration->setNiveau01(null);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return Collection<int, User>
|
||
|
*/
|
||
|
public function getUsers(): Collection
|
||
|
{
|
||
|
return $this->users;
|
||
|
}
|
||
|
|
||
|
public function addUser(User $user): self
|
||
|
{
|
||
|
if (!$this->users->contains($user)) {
|
||
|
$this->users[] = $user;
|
||
|
$user->setNiveau01($this);
|
||
|
}
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function removeUser(User $user): self
|
||
|
{
|
||
|
if ($this->users->removeElement($user)) {
|
||
|
// set the owning side to null (unless already changed)
|
||
|
if ($user->getNiveau01() === $this) {
|
||
|
$user->setNiveau01(null);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* @return Collection<int, UserModo>
|
||
|
*/
|
||
|
public function getModos(): Collection
|
||
|
{
|
||
|
return $this->modos;
|
||
|
}
|
||
|
|
||
|
public function addModo(UserModo $modo): self
|
||
|
{
|
||
|
if (!$this->modos->contains($modo)) {
|
||
|
$this->modos[] = $modo;
|
||
|
$modo->setNiveau01($this);
|
||
|
}
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
public function removeModo(UserModo $modo): self
|
||
|
{
|
||
|
if ($this->modos->removeElement($modo)) {
|
||
|
// set the owning side to null (unless already changed)
|
||
|
if ($modo->getNiveau01() === $this) {
|
||
|
$modo->setNiveau01(null);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
return $this;
|
||
|
}
|
||
|
|
||
|
|
||
|
}
|