src/Entity/Diplome.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\DiplomeRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassDiplomeRepository::class)]
  8. #[ApiResource]
  9. class Diplome
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255nullabletrue)]
  16.     private ?string $titre null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $pdf null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $image null;
  21.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  22.     private ?\DateTimeInterface $dateobtention null;
  23.     #[ORM\ManyToOne(inversedBy'diplome')]
  24.     #[ORM\JoinColumn(referencedColumnName:"id",onDelete"CASCADE"name"user_id")]
  25.     private ?User $user null;
  26.     public function __toString(): string
  27.     {
  28.         return $this->getImage();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getTitre(): ?string
  35.     {
  36.         return $this->titre;
  37.     }
  38.     public function setTitre(?string $titre): self
  39.     {
  40.         $this->titre $titre;
  41.         return $this;
  42.     }
  43.     public function getPdf(): ?string
  44.     {
  45.         return $this->pdf;
  46.     }
  47.     public function setPdf(?string $pdf): self
  48.     {
  49.         $this->pdf $pdf;
  50.         return $this;
  51.     }
  52.     public function getImage(): ?string
  53.     {
  54.         return $this->image;
  55.     }
  56.     public function setImage(?string $image): self
  57.     {
  58.         $this->image $image;
  59.         return $this;
  60.     }
  61.     public function getDateobtention(): ?\DateTimeInterface
  62.     {
  63.         return $this->dateobtention;
  64.     }
  65.     public function setDateobtention(?\DateTimeInterface $dateobtention): self
  66.     {
  67.         $this->dateobtention $dateobtention;
  68.         return $this;
  69.     }
  70.     public function getUser(): ?User
  71.     {
  72.         return $this->user;
  73.     }
  74.     public function setUser(?User $user): self
  75.     {
  76.         $this->user $user;
  77.         return $this;
  78.     }
  79. }