src/Entity/Produit/Produit/Imgproduit.php line 21

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Produit\Produit;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use App\Service\Servicetext\GeneralServicetext;
  5. use App\Validator\Validatortext\Taillemin;
  6. use App\Validator\Validatortext\Taillemax;
  7. use App\Repository\Produit\Produit\ImgproduitRepository;
  8. use Symfony\Component\HttpFoundation\File\File;
  9. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  10. /**
  11.  * Imgproduit
  12.  *
  13.  * @ORM\Table("imgproduit")
  14.  * @ORM\Entity(repositoryClass=ImgproduitRepository::class)
  15.  * @ORM\HasLifecycleCallbacks
  16.  * @Vich\Uploadable
  17.  */
  18. class Imgproduit
  19. {
  20.     /**
  21.      * @var integer
  22.      *
  23.      * @ORM\Column(name="id", type="integer")
  24.      * @ORM\Id
  25.      * @ORM\GeneratedValue(strategy="AUTO")
  26.      */
  27.     private $id;
  28.     
  29.     /**
  30.      * @var \DateTime
  31.      *
  32.      * @ORM\Column(name="date", type="datetime")
  33.      */
  34.     private $date;
  35.     
  36.     /**
  37.      * @ORM\Column(type="string", length=255, nullable=true)
  38.      */
  39.     private $filePath;
  40.     /**
  41.      * @Vich\UploadableField(mapping="file_produit", fileNameProperty="filePath", size="imageSize", mimeType="mimeType", originalName="originalName")
  42.      * @var File|null
  43.      */
  44.     public ?File $file null;
  45.     /**
  46.      * @ORM\Column(type="string", length=255, nullable=true)
  47.      */
  48.     private $imageSize;
  49.     /**
  50.      * @ORM\Column(type="string", length=255, nullable=true)
  51.      */
  52.     private $originalName;
  53.     /**
  54.      * @ORM\Column(type="string", length=255, nullable=true)
  55.      */
  56.     private $mimeType;
  57.     
  58.     // variable du service de normalisation des noms de fichier
  59.     private $servicetext;
  60.     
  61.     public function __construct()
  62.     {
  63.         $this->date = new \Datetime();
  64.     }
  65.     /**
  66.      * Get id
  67.      *
  68.      * @return integer 
  69.      */
  70.     public function getId()
  71.     {
  72.         return $this->id;
  73.     }
  74.     public function setServicetext($service)
  75.     {
  76.         $this->servicetext $service;
  77.     }
  78.     public function getServicetext()
  79.     {
  80.         return $this->servicetext;
  81.     }
  82.     /**
  83.      * Set date
  84.      *
  85.      * @param \DateTime $date
  86.      * @return Imgproduit
  87.      */
  88.     public function setDate($date)
  89.     {
  90.         $this->date $date;
  91.         return $this;
  92.     }
  93.     /**
  94.      * Get date
  95.      *
  96.      * @return \DateTime 
  97.      */
  98.     public function getDate()
  99.     {
  100.         return $this->date;
  101.     }
  102.     public function getContentUrl(): ?string
  103.     {
  104.         return $this->contentUrl;
  105.     }
  106.     public function setContentUrl(?string $contentUrl): self
  107.     {
  108.         $this->contentUrl $contentUrl;
  109.         return $this;
  110.     }
  111.     public function getFilePath(): ?string
  112.     {
  113.         return $this->filePath;
  114.     }
  115.     public function setFilePath(?string $filePath): self
  116.     {
  117.         $this->filePath $filePath;
  118.         return $this;
  119.     }
  120.     public function getImageSize(): ?string
  121.     {
  122.         return $this->imageSize;
  123.     }
  124.     public function setImageSize(?string $imageSize): self
  125.     {
  126.         $this->imageSize $imageSize;
  127.         return $this;
  128.     }
  129.     public function getOriginalName(): ?string
  130.     {
  131.         return $this->originalName;
  132.     }
  133.     public function setOriginalName(?string $originalName): self
  134.     {
  135.         $this->originalName $originalName;
  136.         return $this;
  137.     }
  138.     public function getMimeType(): ?string
  139.     {
  140.         return $this->mimeType;
  141.     }
  142.     public function setMimeType(string $mimeType null): self
  143.     {
  144.         $this->mimeType $mimeType;
  145.         return $this;
  146.     }
  147. }