fix(morelevel): ajout de niveau03 et niveau04
All checks were successful
Cadoles/nineskeletor/pipeline/head This commit looks good

This commit is contained in:
2022-09-27 11:52:49 +02:00
parent 89cb0433c0
commit d1431bcce4
46 changed files with 7163 additions and 3839 deletions

View File

@@ -43,6 +43,14 @@ class Niveau02
*/
private $niveau01;
/**
* @var ArrayCollection
* @var Registration
*
* @ORM\OneToMany(targetEntity="Niveau03", mappedBy="niveau02", cascade={"persist"}, orphanRemoval=false)
*/
private $niveau03s;
/**
* @var ArrayCollection
* @var Registration
@@ -61,6 +69,7 @@ class Niveau02
public function __construct()
{
$this->niveau03s = new ArrayCollection();
$this->registrations = new ArrayCollection();
$this->users = new ArrayCollection();
}
@@ -106,6 +115,36 @@ class Niveau02
return $this;
}
/**
* @return Collection<int, Niveau03>
*/
public function getNiveau03s(): Collection
{
return $this->niveau03s;
}
public function addNiveau03(Niveau03 $niveau03): self
{
if (!$this->niveau03s->contains($niveau03)) {
$this->niveau03s->add($niveau03);
$niveau03->setNiveau02($this);
}
return $this;
}
public function removeNiveau03(Niveau03 $niveau03): self
{
if ($this->niveau03s->removeElement($niveau03)) {
// set the owning side to null (unless already changed)
if ($niveau03->getNiveau02() === $this) {
$niveau03->setNiveau02(null);
}
}
return $this;
}
/**
* @return Collection<int, Registration>
*/
@@ -117,7 +156,7 @@ class Niveau02
public function addRegistration(Registration $registration): self
{
if (!$this->registrations->contains($registration)) {
$this->registrations[] = $registration;
$this->registrations->add($registration);
$registration->setNiveau02($this);
}
@@ -147,7 +186,7 @@ class Niveau02
public function addUser(User $user): self
{
if (!$this->users->contains($user)) {
$this->users[] = $user;
$this->users->add($user);
$user->setNiveau02($this);
}

223
src/Entity/Niveau03.php Normal file
View File

@@ -0,0 +1,223 @@
<?php
namespace App\Entity;
use App\Validator;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity
* @ORM\Table(name="niveau03")
* @ORM\HasLifecycleCallbacks()
* @ORM\Entity(repositoryClass="App\Repository\Niveau03Repository")
*
* @UniqueEntity(fields="label", message="Un Niveau de rang 3 existe déjà avec ce label")
*/
class Niveau03
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=250, unique=true)
* @Validator\Grouplabel()
* @Validator\Niveau02unique()
*/
private $label;
/**
* @ORM\Column(type="string")
*/
private $apikey;
/**
* @ORM\ManyToOne(targetEntity="Niveau02", inversedBy="niveau03s")
* @ORM\JoinColumn(nullable=false)
*/
private $niveau02;
/**
* @var ArrayCollection
* @var Registration
*
* @ORM\OneToMany(targetEntity="Niveau04", mappedBy="niveau03", cascade={"persist"}, orphanRemoval=false)
*/
private $niveau04s;
/**
* @var ArrayCollection
* @var Registration
*
* @ORM\OneToMany(targetEntity="Registration", mappedBy="niveau03", cascade={"persist"}, orphanRemoval=false)
*/
private $registrations;
/**
* @var ArrayCollection
* @var User
*
* @ORM\OneToMany(targetEntity="User", mappedBy="niveau03", cascade={"persist"}, orphanRemoval=false)
*/
private $users;
// == CODE A NE PAS REGENERER
private $niveau01;
public function getNiveau01(): ?Niveau01
{
return $this->niveau02 ? $this->niveau02->getNiveau01() : null;
}
public function setNiveau01(?Niveau01 $niveau01): self
{
$this->niveau01 = $niveau01;
return $this;
}
// ==
public function __construct()
{
$this->niveau04s = new ArrayCollection();
$this->registrations = new ArrayCollection();
$this->users = new ArrayCollection();
}
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 getNiveau02(): ?Niveau02
{
return $this->niveau02;
}
public function setNiveau02(?Niveau02 $niveau02): self
{
$this->niveau02 = $niveau02;
return $this;
}
/**
* @return Collection<int, Niveau04>
*/
public function getNiveau04s(): Collection
{
return $this->niveau04s;
}
public function addNiveau04(Niveau04 $niveau04): self
{
if (!$this->niveau04s->contains($niveau04)) {
$this->niveau04s->add($niveau04);
$niveau04->setNiveau03($this);
}
return $this;
}
public function removeNiveau04(Niveau04 $niveau04): self
{
if ($this->niveau04s->removeElement($niveau04)) {
// set the owning side to null (unless already changed)
if ($niveau04->getNiveau03() === $this) {
$niveau04->setNiveau03(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->add($registration);
$registration->setNiveau03($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->getNiveau03() === $this) {
$registration->setNiveau03(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->add($user);
$user->setNiveau03($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->getNiveau03() === $this) {
$user->setNiveau03(null);
}
}
return $this;
}
}

199
src/Entity/Niveau04.php Normal file
View File

@@ -0,0 +1,199 @@
<?php
namespace App\Entity;
use App\Validator;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ORM\Entity
* @ORM\Table(name="niveau04")
* @ORM\HasLifecycleCallbacks()
* @ORM\Entity(repositoryClass="App\Repository\Niveau04Repository")
*
* @UniqueEntity(fields="label", message="Un Niveau de rang 4 existe déjà avec ce label")
*/
class Niveau04
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=250, unique=true)
* @Validator\Grouplabel()
* @Validator\Niveau02unique()
*/
private $label;
/**
* @ORM\Column(type="string")
*/
private $apikey;
/**
* @ORM\ManyToOne(targetEntity="Niveau03", inversedBy="niveau04s")
* @ORM\JoinColumn(nullable=false)
*/
private $niveau03;
/**
* @var ArrayCollection
* @var Registration
*
* @ORM\OneToMany(targetEntity="Registration", mappedBy="niveau04", cascade={"persist"}, orphanRemoval=false)
*/
private $registrations;
/**
* @var ArrayCollection
* @var User
*
* @ORM\OneToMany(targetEntity="User", mappedBy="niveau04", cascade={"persist"}, orphanRemoval=false)
*/
private $users;
// == CODE A NE PAS REGENERER
private $niveau01;
public function getNiveau01(): ?Niveau01
{
return $this->niveau03 ? $this->niveau03->getNiveau02()->getNiveau01() : null;
}
public function setNiveau01(?Niveau01 $niveau01): self
{
$this->niveau01 = $niveau01;
return $this;
}
private $niveau02;
public function getNiveau02(): ?Niveau02
{
return $this->niveau03 ? $this->niveau03->getNiveau02() : null;
}
public function setNiveau02(?Niveau02 $niveau02): self
{
$this->niveau02 = $niveau02;
return $this;
}
// ==
public function __construct()
{
$this->registrations = new ArrayCollection();
$this->users = new ArrayCollection();
}
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 getNiveau03(): ?Niveau03
{
return $this->niveau03;
}
public function setNiveau03(?Niveau03 $niveau03): self
{
$this->niveau03 = $niveau03;
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->add($registration);
$registration->setNiveau04($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->getNiveau04() === $this) {
$registration->setNiveau04(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->add($user);
$user->setNiveau04($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->getNiveau04() === $this) {
$user->setNiveau04(null);
}
}
return $this;
}
}

View File

@@ -122,6 +122,16 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
*/
private $niveau02;
/**
* @ORM\ManyToOne(targetEntity="Niveau03", inversedBy="registrations")
*/
private $niveau03;
/**
* @ORM\ManyToOne(targetEntity="Niveau04", inversedBy="registrations")
*/
private $niveau04;
// == CODE A NE PAS REGENERER
private $roles;
@@ -410,4 +420,28 @@ class Registration implements UserInterface, LegacyPasswordAuthenticatedUserInte
return $this;
}
public function getNiveau03(): ?Niveau03
{
return $this->niveau03;
}
public function setNiveau03(?Niveau03 $niveau03): self
{
$this->niveau03 = $niveau03;
return $this;
}
public function getNiveau04(): ?Niveau04
{
return $this->niveau04;
}
public function setNiveau04(?Niveau04 $niveau04): self
{
$this->niveau04 = $niveau04;
return $this;
}
}

View File

@@ -152,6 +152,16 @@ class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
*/
private $niveau02;
/**
* @ORM\ManyToOne(targetEntity="Niveau03", inversedBy="users")
*/
private $niveau03;
/**
* @ORM\ManyToOne(targetEntity="Niveau04", inversedBy="users")
*/
private $niveau04;
/**
* @var ArrayCollection
* @var UserGroup
@@ -621,4 +631,28 @@ class User implements UserInterface, LegacyPasswordAuthenticatedUserInterface
return $this;
}
public function getNiveau03(): ?Niveau03
{
return $this->niveau03;
}
public function setNiveau03(?Niveau03 $niveau03): self
{
$this->niveau03 = $niveau03;
return $this;
}
public function getNiveau04(): ?Niveau04
{
return $this->niveau04;
}
public function setNiveau04(?Niveau04 $niveau04): self
{
$this->niveau04 = $niveau04;
return $this;
}
}