src/Entity/OldMinistre.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ORM\CustomIdGenerator;
  4. use Symfony\Component\Uid\Uuid;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\HttpFoundation\File\File;
  7. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  8. use Symfony\Component\Validator\Constraints as Assert;
  9. /**
  10.  * @ORM\Entity(repositoryClass="App\Repository\OldMinistreRepository")
  11.  * @Vich\Uploadable
  12.  */
  13. class OldMinistre
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\Column(type="uuid", unique=true)
  18.      */
  19.     private $id;
  20.     /**
  21.      * @ORM\Column(type="string", length=255)
  22.      */
  23.     private $fullname;
  24.     /**
  25.      * @ORM\Column(type="string", length=255,nullable=true)
  26.      *
  27.      */
  28.     private $photo;
  29.     /**
  30.      * @ORM\Column(type="string", length=255, nullable=true)
  31.      * @Assert\Url(message="Entrez un lien valide")
  32.      */
  33.     private $lienFacebook;
  34.     /**
  35.      * @ORM\Column(type="string", length=255, nullable=true)
  36.      * @Assert\Url(message="Entrez un lien valide")
  37.      */
  38.     private $lienLinkdln;
  39.     /**
  40.      * @ORM\Column(type="string", length=255, nullable=true)
  41.      * @Assert\Url(message="Entrez un lien valide")
  42.      */
  43.     private $lienTwitter;
  44.     /**
  45.      * @Assert\File(
  46.      *     mimeTypes = {"image/png", "image/gif", "image/jpeg", "image/jpg"},
  47.      *     mimeTypesMessage = "SVP seuls les fichiers image d'extension png, gif, jpeg et jpg sont requis."
  48.      * )
  49.      * @Vich\UploadableField(mapping="medias", fileNameProperty="photo")
  50.      * @var File
  51.      */
  52.     private $nameImage;
  53.     /**
  54.      * @ORM\Column(type="date")
  55.      */
  56.     private $startdate;
  57.     /**
  58.      * @ORM\Column(type="date")
  59.      */
  60.     private $enddate;
  61.     /**
  62.      * @ORM\Column(type="uuid", unique=true)
  63.      */
  64.     private $uid;
  65.     /**
  66.      * @ORM\Column(type="text", nullable=true)
  67.      */
  68.     private $biographie;
  69.     public function __construct()
  70.     {
  71.         $this->uid Uuid::v4();
  72.         $this->id Uuid::v4();
  73.     }
  74.     public function getId(): ?uuid
  75.     {
  76.         return $this->id;
  77.     }
  78.     public function getFullname(): ?string
  79.     {
  80.         return $this->fullname;
  81.     }
  82.     public function setFullname(string $fullname): self
  83.     {
  84.         $this->fullname $fullname;
  85.         return $this;
  86.     }
  87.     public function getPhoto(): ?string
  88.     {
  89.         return $this->photo;
  90.     }
  91.     public function setPhoto(?string $photo): self
  92.     {
  93.         $this->photo $photo;
  94.         return $this;
  95.     }
  96.     public function getLienFacebook(): ?string
  97.     {
  98.         return $this->lienFacebook;
  99.     }
  100.     public function setLienFacebook(?string $lienFacebook): self
  101.     {
  102.         $this->lienFacebook $lienFacebook;
  103.         return $this;
  104.     }
  105.     public function getLienLinkdln(): ?string
  106.     {
  107.         return $this->lienLinkdln;
  108.     }
  109.     public function setLienLinkdln(?string $lienLinkdln): self
  110.     {
  111.         $this->lienLinkdln $lienLinkdln;
  112.         return $this;
  113.     }
  114.     public function getLienTwitter(): ?string
  115.     {
  116.         return $this->lienTwitter;
  117.     }
  118.     public function setLienTwitter(?string $lienTwitter): self
  119.     {
  120.         $this->lienTwitter $lienTwitter;
  121.         return $this;
  122.     }
  123.     /**
  124.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  125.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  126.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  127.      * must be able to accept an instance of 'File' as the bundle will inject one here
  128.      * during Doctrine hydration.
  129.      *
  130.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $nameImage
  131.      */
  132.     public function setNameImage(?File $nameImage null): void
  133.     {
  134.         $this->nameImage $nameImage;
  135.     }
  136.     public function getNameImage(): ?File
  137.     {
  138.         return $this->nameImage;
  139.     }
  140.     public function getStartdate(): ?\DateTimeInterface
  141.     {
  142.         return $this->startdate;
  143.     }
  144.     public function setStartdate(\DateTimeInterface $startdate): self
  145.     {
  146.         $this->startdate $startdate;
  147.         return $this;
  148.     }
  149.     public function getEnddate(): ?\DateTimeInterface
  150.     {
  151.         return $this->enddate;
  152.     }
  153.     public function setEnddate(\DateTimeInterface $enddate): self
  154.     {
  155.         $this->enddate $enddate;
  156.         return $this;
  157.     }
  158.     public function getUid(): ?string
  159.     {
  160.         return $this->uid;
  161.     }
  162.     public function setUid(string $uid): self
  163.     {
  164.         $this->uid $uid;
  165.         return $this;
  166.     }
  167.     public function getBiographie(): ?string
  168.     {
  169.         return $this->biographie;
  170.     }
  171.     public function setBiographie(?string $biographie): self
  172.     {
  173.         $this->biographie $biographie;
  174.         return $this;
  175.     }
  176. }