src/Entity/Gos/FileVersion.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  5. use Symfony\Component\Validator\Constraints as Assert;
  6. /**
  7.  * @ORM\Entity(repositoryClass="App\Repository\Gos\FileVersionRepository")
  8.  * @ORM\HasLifecycleCallbacks()
  9.  * @Vich\Uploadable()
  10.  */
  11. class FileVersion
  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 $label;
  23.     /**
  24.      * @ORM\Column(type="datetime")
  25.      */
  26.     private $createdAt;
  27.     /**
  28.      * @ORM\Column(type="datetime", nullable=true)
  29.      */
  30.     private $updatedAt;
  31.     /**
  32.      * @ORM\ManyToOne(targetEntity="App\Entity\Gos\File", inversedBy="versions")
  33.      * @ORM\JoinColumn()
  34.      */
  35.     private $fileEntity;
  36.     /**
  37.      * @Vich\UploadableField(mapping="product_files", fileNameProperty="fileName", size="fileSize", mimeType="mimeType")
  38.      * @Assert\File(maxSize="800M")
  39.      */
  40.     private $file;
  41.     /**
  42.      * @ORM\Column(type="string", length=255, nullable=true)
  43.      */
  44.     private $fileName;
  45.     /**
  46.      * @ORM\Column(type="string", length=255, nullable=true)
  47.      */
  48.     private $mimeType;
  49.     /**
  50.      * @ORM\Column(type="integer", nullable=true)
  51.      */
  52.     private $fileSize;
  53.     /**
  54.      * @ORM\Column(type="boolean")
  55.      */
  56.     private $isBaseFile true;
  57.     /**
  58.      * @ORM\Column(type="boolean")
  59.      */
  60.     private $isShowable true;
  61.     /** @ORM\PrePersist() */
  62.     public function onPrePersist(): void
  63.     {
  64.         $this->createdAt = new \DateTime();
  65.     }
  66.     /** @ORM\PreUpdate() */
  67.     public function onPreUpdate(): void
  68.     {
  69.         $this->updatedAt = new \DateTime();
  70.     }
  71.     public function getId(): ?int
  72.     {
  73.         return $this->id;
  74.     }
  75.     public function getLabel(): ?string
  76.     {
  77.         return $this->label;
  78.     }
  79.     public function setLabel(string $label): self
  80.     {
  81.         $this->label $label;
  82.         return $this;
  83.     }
  84.     public function getCreatedAt(): ?\DateTimeInterface
  85.     {
  86.         return $this->createdAt;
  87.     }
  88.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  89.     {
  90.         $this->createdAt $createdAt;
  91.         return $this;
  92.     }
  93.     public function getUpdatedAt(): ?\DateTimeInterface
  94.     {
  95.         return $this->updatedAt;
  96.     }
  97.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  98.     {
  99.         $this->updatedAt $updatedAt;
  100.         return $this;
  101.     }
  102.     public function getFileEntity(): ?File
  103.     {
  104.         return $this->fileEntity;
  105.     }
  106.     public function setFileEntity(?File $fileEntity): self
  107.     {
  108.         $this->fileEntity $fileEntity;
  109.         return $this;
  110.     }
  111.     public function getFile(): ?\Symfony\Component\HttpFoundation\File\File
  112.     {
  113.         return $this->file;
  114.     }
  115.     public function setFile(?\Symfony\Component\HttpFoundation\File\File $file null): void
  116.     {
  117.         $this->file $file;
  118.         if (null !== $file) {
  119.             $this->updatedAt = new \DateTimeImmutable();
  120.         }
  121.     }
  122.     public function getFileName(): ?string
  123.     {
  124.         return $this->fileName;
  125.     }
  126.     public function setFileName(?string $fileName): self
  127.     {
  128.         $this->fileName $fileName;
  129.         return $this;
  130.     }
  131.     public function getMimeType(): ?string
  132.     {
  133.         return $this->mimeType;
  134.     }
  135.     public function setMimeType(?string $mimeType): self
  136.     {
  137.         $this->mimeType $mimeType;
  138.         return $this;
  139.     }
  140.     public function getFileSize(): ?int
  141.     {
  142.         return $this->fileSize;
  143.     }
  144.     public function setFileSize(?int $fileSize): self
  145.     {
  146.         $this->fileSize $fileSize;
  147.         return $this;
  148.     }
  149.     public function getIsBaseFile(): ?bool
  150.     {
  151.         return $this->isBaseFile;
  152.     }
  153.     public function setIsBaseFile(bool $isBaseFile): self
  154.     {
  155.         $this->isBaseFile $isBaseFile;
  156.         return $this;
  157.     }
  158.     public function getIsShowable(): ?bool
  159.     {
  160.         return $this->isShowable;
  161.     }
  162.     public function setIsShowable(bool $isShowable): self
  163.     {
  164.         $this->isShowable $isShowable;
  165.         return $this;
  166.     }
  167. }