<?php
namespace App\Entity;
use App\Repository\UserCodeRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: UserCodeRepository::class)]
class UserCode
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 8)]
private ?string $code = null;
#[ORM\Column]
private ?bool $actif = null;
#[ORM\Column]
private ?bool $valid = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE)]
private ?\DateTimeInterface $dateEmission = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $dateValid = null;
#[ORM\ManyToOne(inversedBy: 'userCodes')]
#[ORM\JoinColumn(nullable: false)]
private ?User $utilisateur = null;
public function getId(): ?int
{
return $this->id;
}
public function getCode(): ?string
{
return $this->code;
}
public function setCode(string $code): static
{
$this->code = $code;
return $this;
}
public function isActif(): ?bool
{
return $this->actif;
}
public function setActif(bool $actif): static
{
$this->actif = $actif;
return $this;
}
public function isValid(): ?bool
{
return $this->valid;
}
public function setValid(bool $valid): static
{
$this->valid = $valid;
return $this;
}
public function getDateEmission(): ?\DateTimeInterface
{
return $this->dateEmission;
}
public function setDateEmission(\DateTimeInterface $dateEmission): static
{
$this->dateEmission = $dateEmission;
return $this;
}
public function getDateValid(): ?\DateTimeInterface
{
return $this->dateValid;
}
public function setDateValid(?\DateTimeInterface $dateValid): static
{
$this->dateValid = $dateValid;
return $this;
}
public function getUtilisateur(): ?User
{
return $this->utilisateur;
}
public function setUtilisateur(?User $utilisateur): static
{
$this->utilisateur = $utilisateur;
return $this;
}
}