<?php
namespace App\Entity\Produit\Produit;
use Doctrine\ORM\Mapping as ORM;
use App\Service\Servicetext\GeneralServicetext;
use App\Validator\Validatortext\Taillemin;
use App\Validator\Validatortext\Taillemax;
use App\Repository\Produit\Produit\ImgproduitRepository;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* Imgproduit
*
* @ORM\Table("imgproduit")
* @ORM\Entity(repositoryClass=ImgproduitRepository::class)
* @ORM\HasLifecycleCallbacks
* @Vich\Uploadable
*/
class Imgproduit
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var \DateTime
*
* @ORM\Column(name="date", type="datetime")
*/
private $date;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $filePath;
/**
* @Vich\UploadableField(mapping="file_produit", fileNameProperty="filePath", size="imageSize", mimeType="mimeType", originalName="originalName")
* @var File|null
*/
public ?File $file = null;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $imageSize;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $originalName;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $mimeType;
// variable du service de normalisation des noms de fichier
private $servicetext;
public function __construct()
{
$this->date = new \Datetime();
}
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
public function setServicetext($service)
{
$this->servicetext = $service;
}
public function getServicetext()
{
return $this->servicetext;
}
/**
* Set date
*
* @param \DateTime $date
* @return Imgproduit
*/
public function setDate($date)
{
$this->date = $date;
return $this;
}
/**
* Get date
*
* @return \DateTime
*/
public function getDate()
{
return $this->date;
}
public function getContentUrl(): ?string
{
return $this->contentUrl;
}
public function setContentUrl(?string $contentUrl): self
{
$this->contentUrl = $contentUrl;
return $this;
}
public function getFilePath(): ?string
{
return $this->filePath;
}
public function setFilePath(?string $filePath): self
{
$this->filePath = $filePath;
return $this;
}
public function getImageSize(): ?string
{
return $this->imageSize;
}
public function setImageSize(?string $imageSize): self
{
$this->imageSize = $imageSize;
return $this;
}
public function getOriginalName(): ?string
{
return $this->originalName;
}
public function setOriginalName(?string $originalName): self
{
$this->originalName = $originalName;
return $this;
}
public function getMimeType(): ?string
{
return $this->mimeType;
}
public function setMimeType(string $mimeType = null): self
{
$this->mimeType = $mimeType;
return $this;
}
}