src/Entity/DiplomeFormateur.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DiplomeFormateurRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. /**
  8.  * @ORM\Entity(repositoryClass=DiplomeFormateurRepository::class)
  9.  *  @Vich\Uploadable
  10.  */
  11. class DiplomeFormateur
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\ManyToOne(targetEntity=Formateur::class, inversedBy="diplomeFormateurs")
  21.      * @ORM\JoinColumn(nullable=false)
  22.      */
  23.     private $formateur;
  24.     /**
  25.      * @ORM\Column(type="date", nullable=true)
  26.      */
  27.     private $datediplome;
  28.     /**
  29.      * @ORM\Column(type="date", nullable=true)
  30.      */
  31.     private $datefinvalidite;
  32.     /**
  33.      * @ORM\Column(type="date", nullable=true)
  34.      */
  35.     private $daterecyclage;
  36.     /**
  37.      * @ORM\Column(type="datetime_immutable", nullable=true)
  38.      */
  39.     private $created_at;
  40.     /**
  41.      * @ORM\Column(type="datetime_immutable", nullable=true)
  42.      */
  43.     private $updated_at;
  44.     /**
  45.      * @Doctrine\ORM\Mapping\Column(type="text", length=255, nullable=true)
  46.      */
  47.     private $url;
  48.     /**
  49.      * @Vich\UploadableField(mapping="piece_formateur", fileNameProperty="url")
  50.      */
  51.     private $fichier;
  52.     public function __construct()
  53.     {
  54.         $this->created_at = new \DateTimeImmutable();   
  55.     }
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getFormateur(): ?Formateur
  61.     {
  62.         return $this->formateur;
  63.     }
  64.     public function setFormateur(?Formateur $formateur): self
  65.     {
  66.         $this->formateur $formateur;
  67.         return $this;
  68.     }
  69.     public function getDatediplome(): ?\DateTimeInterface
  70.     {
  71.         return $this->datediplome;
  72.     }
  73.     public function setDatediplome(?\DateTimeInterface $datediplome): self
  74.     {
  75.         $this->datediplome $datediplome;
  76.         return $this;
  77.     }
  78.     public function getDatefinvalidite(): ?\DateTimeInterface
  79.     {
  80.         return $this->datefinvalidite;
  81.     }
  82.     public function setDatefinvalidite(?\DateTimeInterface $datefinvalidite): self
  83.     {
  84.         $this->datefinvalidite $datefinvalidite;
  85.         return $this;
  86.     }
  87.     public function getDaterecyclage(): ?\DateTimeInterface
  88.     {
  89.         return $this->daterecyclage;
  90.     }
  91.     public function setDaterecyclage(?\DateTimeInterface $daterecyclage): self
  92.     {
  93.         $this->daterecyclage $daterecyclage;
  94.         return $this;
  95.     }
  96.     public function getCreatedAt(): ?\DateTimeImmutable
  97.     {
  98.         return $this->created_at;
  99.     }
  100.     public function setCreatedAt(?\DateTimeImmutable $created_at): self
  101.     {
  102.         $this->created_at $created_at;
  103.         return $this;
  104.     }
  105.     public function getUpdatedAt(): ?\DateTimeImmutable
  106.     {
  107.         return $this->updated_at;
  108.     }
  109.     public function setUpdatedAt(?\DateTimeImmutable $updated_at): self
  110.     {
  111.         $this->updated_at $updated_at;
  112.         return $this;
  113.     }
  114.     public function setFichier(?File $image null)
  115.     {
  116.         $this->fichier $image;
  117.         if ($image) {
  118.             $this->updatedAt = new \DateTime('now');
  119.         }
  120.     }
  121.     public function getFichier()
  122.     {
  123.         return $this->fichier;
  124.     }
  125.     
  126.     public function setUrl($url)
  127.     {
  128.         $this->url $url;
  129.     }
  130.     public function getUrl()
  131.     {
  132.         return $this->url;
  133.     }
  134. }