Entité
This commit is contained in:
@@ -6,16 +6,15 @@ use App\Repository\ParticipantRepository;
|
||||
use Doctrine\Common\Collections\ArrayCollection;
|
||||
use Doctrine\Common\Collections\Collection;
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use Symfony\Component\Uid\Uuid;
|
||||
|
||||
#[ORM\Entity(repositoryClass: ParticipantRepository::class)]
|
||||
class Participant
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\Column(type: 'uuid', unique: true)]
|
||||
#[ORM\Column(type: 'guid', unique: true)]
|
||||
#[ORM\GeneratedValue(strategy: 'CUSTOM')]
|
||||
#[ORM\CustomIdGenerator(class: 'doctrine.uuid_generator')]
|
||||
private ?Uuid $idParticipant = null;
|
||||
private ?string $idParticipant = null;
|
||||
|
||||
#[ORM\Column(length: 255)]
|
||||
private ?string $nom = null;
|
||||
@@ -53,11 +52,10 @@ class Participant
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->idParticipant = Uuid::v4(); // Génération automatique de l'UUID
|
||||
$this->sorties = new ArrayCollection();
|
||||
}
|
||||
|
||||
public function getIdParticipant(): ?Uuid
|
||||
public function getIdParticipant(): ?string
|
||||
{
|
||||
return $this->idParticipant;
|
||||
}
|
||||
@@ -137,7 +135,7 @@ class Participant
|
||||
public function getRoles(): array
|
||||
{
|
||||
$roles = $this->roles;
|
||||
// Garantit que chaque utilisateur a au moins le rôle ROLE_USER
|
||||
// Garantir que chaque utilisateur a au moins le rôle ROLE_USER
|
||||
$roles[] = 'ROLE_USER';
|
||||
|
||||
return array_unique($roles);
|
||||
|
||||
Reference in New Issue
Block a user