first commit symfony 6
This commit is contained in:
62
src/Entity/UserModo.php
Normal file
62
src/Entity/UserModo.php
Normal file
@ -0,0 +1,62 @@
|
||||
<?php
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="usermodo")
|
||||
*
|
||||
* @UniqueEntity(fields={"user", "niveau01"}, message="Cette liaison existe déjà !")
|
||||
*/
|
||||
class UserModo
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="User", inversedBy="modos")
|
||||
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", nullable=false)
|
||||
*/
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Niveau01", inversedBy="modos")
|
||||
* @ORM\JoinColumn(name="niveau01_id", referencedColumnName="id", nullable=false)
|
||||
*/
|
||||
private $niveau01;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getUser(): ?User
|
||||
{
|
||||
return $this->user;
|
||||
}
|
||||
|
||||
public function setUser(?User $user): self
|
||||
{
|
||||
$this->user = $user;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getNiveau01(): ?Niveau01
|
||||
{
|
||||
return $this->niveau01;
|
||||
}
|
||||
|
||||
public function setNiveau01(?Niveau01 $niveau01): self
|
||||
{
|
||||
$this->niveau01 = $niveau01;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user