<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\CertificatRepository;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CertificatRepository::class)]
#[ApiResource]
class Certificat
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $titre = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $lien = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $pdf = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $image = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $dateobtention = null;
#[ORM\Column(type: Types::DATETIME_MUTABLE, nullable: true)]
private ?\DateTimeInterface $datevalidite = null;
#[ORM\ManyToOne(inversedBy: 'certificat')]
#[ORM\JoinColumn(referencedColumnName:"id",onDelete: "CASCADE", name: "user_id")]
private ?User $user = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $slug = null;
public function __toString(): string
{
return $this->getTitre();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(?string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getLien(): ?string
{
return $this->lien;
}
public function setLien(?string $lien): self
{
$this->lien = $lien;
return $this;
}
public function getPdf(): ?string
{
return $this->pdf;
}
public function setPdf(?string $pdf): self
{
$this->pdf = $pdf;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function getDateobtention(): ?\DateTimeInterface
{
return $this->dateobtention;
}
public function setDateobtention(?\DateTimeInterface $dateobtention): self
{
$this->dateobtention = $dateobtention;
return $this;
}
public function getDatevalidite(): ?\DateTimeInterface
{
return $this->datevalidite;
}
public function setDatevalidite(?\DateTimeInterface $datevalidite): self
{
$this->datevalidite = $datevalidite;
return $this;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(?User $user): self
{
$this->user = $user;
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
}