src/Entity/Certificats.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CertificatsRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  6. #[ORM\Entity(repositoryClassCertificatsRepository::class)]
  7. #[ORM\Table(name"certificats")]
  8. #[UniqueEntity(
  9.     fields: ['theme''ville''session''type''prix''devise'],
  10.     message'Ce Certificat est déjà enrégistré'
  11. )]
  12. class Certificats
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     private ?int $id null;
  18.     // Relation avec une table Theme (si elle existe)
  19.     #[ORM\Column(type"string"nullabletrue)]
  20.     private ?string $theme null;
  21.     
  22.     #[ORM\Column(type"string"nullabletrue)]
  23.     private ?string $slug null;
  24.     // Relation avec table Ville (si elle existe)
  25.     #[ORM\ManyToOne]
  26.     #[ORM\JoinColumn(name"ville_id"referencedColumnName"id"nullabletrue)]
  27.     private ?Villes $ville null;
  28.     #[ORM\Column(type"string"nullabletrue)]
  29.     private ?string $session null;
  30.     #[ORM\Column(type"string"nullabletrue)]
  31.     private ?string $type null;
  32.     #[ORM\Column(type"string"nullabletrue)]
  33.     private ?string $prix null;
  34.     #[ORM\Column(length10nullabletrueoptions: ['default' => 'EURO'])]
  35.     private ?string $devise 'EURO';
  36.     
  37.     #[ORM\Column(length10)]
  38.     private ?int $adminsid;
  39.     #[ORM\Column(type"datetime"nullabletrueoptions: ['default' => 'CURRENT_TIMESTAMP'])]
  40.     private ?\DateTimeInterface $createdat null;
  41.     #[ORM\Column(type"datetime"nullabletrueoptions: ['default' => 'CURRENT_TIMESTAMP'])]
  42.     private ?\DateTimeInterface $updatedat null;
  43.     
  44.     public function __construct()
  45.     {
  46.         $this->createdat = new \DateTime();
  47.         $this->updatedat = new \DateTime();
  48.     }
  49.     public function getId(): ?int{return $this->id;}
  50.     // public function getCatid(): ?Categories { return $this->catid; }
  51.     // public function setCatid(?Categories $catid): static { $this->catid = $catid; return $this; }
  52.     public function getTheme(): ?String{return $this->theme;}
  53.     public function setTheme(?String $theme): self{$this->theme $theme;return $this;}
  54.     public function getSlug(): ?String{return $this->slug;}
  55.     public function setSlug(?String $slug): self{$this->slug $slug;return $this;}
  56.     public function getVille(): ?Villes{ return $this->ville;}
  57.     public function setVille(?Villes $ville): self{$this->ville $ville;return $this;}
  58.     public function getSession(): ?String{ return $this->session;}
  59.     public function setSession(?String $session): self $this->session $session;return $this;}
  60.     
  61.     public function getType(): ?String{ return $this->type;}
  62.     public function setType(?String $type): self $this->type $type;return $this;}
  63.     public function getPrix(): ?string{return $this->prix;}
  64.     public function setPrix(?string $prix): self{$this->prix $prix;return $this;}
  65.     public function getDevise(): ?string{return $this->devise;}
  66.     public function setDevise(?string $devise): self{$this->devise $devise;return $this;}
  67.     public function getAdminsId(): ?int{return $this->adminsid;}
  68.     public function setAdminsId(int $adminsid): static{$this->adminsid $adminsid;return $this;}
  69.     public function getCreatedAt(): ?\DateTimeInterface{return $this->createdat;}
  70.     public function setCreatedAt(?\DateTimeInterface $createdat): self {$this->createdat $createdat;return $this;}
  71.     
  72.     public function getUpdatedAt(): ?\DateTimeInterface{return $this->updatedat;}
  73.     public function setUpdatedAt(?\DateTimeInterface $updatedat): self {$this->updatedat $updatedat;return $this;}
  74. }