<?php
namespace App\Entity;
use App\Repository\CertificatsRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
#[ORM\Entity(repositoryClass: CertificatsRepository::class)]
#[ORM\Table(name: "certificats")]
#[UniqueEntity(
fields: ['theme', 'ville', 'session', 'type', 'prix', 'devise'],
message: 'Ce Certificat est déjà enrégistré'
)]
class Certificats
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
// Relation avec une table Theme (si elle existe)
#[ORM\Column(type: "string", nullable: true)]
private ?string $theme = null;
#[ORM\Column(type: "string", nullable: true)]
private ?string $slug = null;
// Relation avec table Ville (si elle existe)
#[ORM\ManyToOne]
#[ORM\JoinColumn(name: "ville_id", referencedColumnName: "id", nullable: true)]
private ?Villes $ville = null;
#[ORM\Column(type: "string", nullable: true)]
private ?string $session = null;
#[ORM\Column(type: "string", nullable: true)]
private ?string $type = null;
#[ORM\Column(type: "string", nullable: true)]
private ?string $prix = null;
#[ORM\Column(length: 10, nullable: true, options: ['default' => 'EURO'])]
private ?string $devise = 'EURO';
#[ORM\Column(length: 10)]
private ?int $adminsid;
#[ORM\Column(type: "datetime", nullable: true, options: ['default' => 'CURRENT_TIMESTAMP'])]
private ?\DateTimeInterface $createdat = null;
#[ORM\Column(type: "datetime", nullable: true, options: ['default' => 'CURRENT_TIMESTAMP'])]
private ?\DateTimeInterface $updatedat = null;
public function __construct()
{
$this->createdat = new \DateTime();
$this->updatedat = new \DateTime();
}
public function getId(): ?int{return $this->id;}
// public function getCatid(): ?Categories { return $this->catid; }
// public function setCatid(?Categories $catid): static { $this->catid = $catid; return $this; }
public function getTheme(): ?String{return $this->theme;}
public function setTheme(?String $theme): self{$this->theme = $theme;return $this;}
public function getSlug(): ?String{return $this->slug;}
public function setSlug(?String $slug): self{$this->slug = $slug;return $this;}
public function getVille(): ?Villes{ return $this->ville;}
public function setVille(?Villes $ville): self{$this->ville = $ville;return $this;}
public function getSession(): ?String{ return $this->session;}
public function setSession(?String $session): self { $this->session = $session;return $this;}
public function getType(): ?String{ return $this->type;}
public function setType(?String $type): self { $this->type = $type;return $this;}
public function getPrix(): ?string{return $this->prix;}
public function setPrix(?string $prix): self{$this->prix = $prix;return $this;}
public function getDevise(): ?string{return $this->devise;}
public function setDevise(?string $devise): self{$this->devise = $devise;return $this;}
public function getAdminsId(): ?int{return $this->adminsid;}
public function setAdminsId(int $adminsid): static{$this->adminsid = $adminsid;return $this;}
public function getCreatedAt(): ?\DateTimeInterface{return $this->createdat;}
public function setCreatedAt(?\DateTimeInterface $createdat): self {$this->createdat = $createdat;return $this;}
public function getUpdatedAt(): ?\DateTimeInterface{return $this->updatedat;}
public function setUpdatedAt(?\DateTimeInterface $updatedat): self {$this->updatedat = $updatedat;return $this;}
}