src/Entity/Cabinet.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Symfony\Component\HttpFoundation\File\File;
  5. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\CabinetRepository")
  9.  * @Vich\Uploadable
  10.  */
  11. class Cabinet
  12. {
  13.     /**
  14.      * @ORM\Id()
  15.      * @ORM\GeneratedValue()
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @ORM\Column(type="string", length=255)
  21.      */
  22.     private $titre;
  23.     /**
  24.      * @ORM\Column(type="string", length=255)
  25.      */
  26.     private $fullname;
  27.     /**
  28.      * @ORM\Column(type="string", length=255,nullable=true)
  29.      *
  30.      */
  31.     private $photo;
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=true)
  34.      * @Assert\Url(message="Entrez un lien valide")
  35.      */
  36.     private $lienFacebook;
  37.     /**
  38.      * @ORM\Column(type="string", length=255, nullable=true)
  39.      *  @Assert\Url(message="Entrez un lien valide")
  40.      */
  41.     private $lienLinkdln;
  42.     /**
  43.      * @ORM\Column(type="string", length=255, nullable=true)
  44.      *  @Assert\Url(message="Entrez un lien valide")
  45.      */
  46.     private $lienTwitter;
  47.     /**
  48.      * @Assert\File(
  49.      *     mimeTypes = {"image/png", "image/gif", "image/jpeg", "image/jpg"},
  50.      *     mimeTypesMessage = "SVP seuls les fichiers image d'extension png, gif, jpeg et jpg sont requis."
  51.      * )
  52.      * @Vich\UploadableField(mapping="medias", fileNameProperty="photo")
  53.      * @var File
  54.      */
  55.     private $nameImage;
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getTitre(): ?string
  61.     {
  62.         return $this->titre;
  63.     }
  64.     public function setTitre(string $titre): self
  65.     {
  66.         $this->titre $titre;
  67.         return $this;
  68.     }
  69.     public function getFullname(): ?string
  70.     {
  71.         return $this->fullname;
  72.     }
  73.     public function setFullname(string $fullname): self
  74.     {
  75.         $this->fullname $fullname;
  76.         return $this;
  77.     }
  78.     public function getPhoto(): ?string
  79.     {
  80.         return $this->photo;
  81.     }
  82.     public function setPhoto(?string $photo): self
  83.     {
  84.         $this->photo $photo;
  85.         return $this;
  86.     }
  87.     public function getLienFacebook(): ?string
  88.     {
  89.         return $this->lienFacebook;
  90.     }
  91.     public function setLienFacebook(?string $lienFacebook): self
  92.     {
  93.         $this->lienFacebook $lienFacebook;
  94.         return $this;
  95.     }
  96.     public function getLienLinkdln(): ?string
  97.     {
  98.         return $this->lienLinkdln;
  99.     }
  100.     public function setLienLinkdln(?string $lienLinkdln): self
  101.     {
  102.         $this->lienLinkdln $lienLinkdln;
  103.         return $this;
  104.     }
  105.     public function getLienTwitter(): ?string
  106.     {
  107.         return $this->lienTwitter;
  108.     }
  109.     public function setLienTwitter(?string $lienTwitter): self
  110.     {
  111.         $this->lienTwitter $lienTwitter;
  112.         return $this;
  113.     }
  114.     /**
  115.      * If manually uploading a file (i.e. not using Symfony Form) ensure an instance
  116.      * of 'UploadedFile' is injected into this setter to trigger the update. If this
  117.      * bundle's configuration parameter 'inject_on_load' is set to 'true' this setter
  118.      * must be able to accept an instance of 'File' as the bundle will inject one here
  119.      * during Doctrine hydration.
  120.      *
  121.      * @param File|\Symfony\Component\HttpFoundation\File\UploadedFile $nameImage
  122.      */
  123.     public function setNameImage(?File $nameImage null): void
  124.     {
  125.         $this->nameImage $nameImage;
  126.     }
  127.     public function getNameImage(): ?File
  128.     {
  129.         return $this->nameImage;
  130.     }
  131. }