src/Entity/File.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FileRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=FileRepository::class)
  7.  */
  8. class File
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="datetime")
  18.      */
  19.     private $createdAt;
  20.     /**
  21.      * @ORM\Column(type="enum", nullable=true, options={"values"="file_enum"})
  22.      */
  23.     private $type;
  24.     /**
  25.      * @ORM\Column(type="text")
  26.      */
  27.     private $path;
  28.     /**
  29.      * @ORM\Column(type="string", length=255, nullable=true)
  30.      */
  31.     private $originalHash;
  32.     /**
  33.      * @ORM\Column(type="string", length=255, nullable=true)
  34.      */
  35.     private $compressedHash;
  36.     /**
  37.      * @ORM\Column(type="text", nullable=true)
  38.      */
  39.     private $originalFileName;
  40.     /**
  41.      * @ORM\Column(type="integer", nullable=true)
  42.      */
  43.     private $reuploadsCount;
  44.     /**
  45.      * @ORM\Column(type="integer", nullable=true)
  46.      */
  47.     private $size;
  48.     /**
  49.      * @ORM\Column(type="integer", nullable=true)
  50.      */
  51.     private $uploadMinutes;
  52.     public function __construct()
  53.     {
  54.         $this->createdAt = new \DateTime();
  55.     }
  56.     public function getId(): ?int
  57.     {
  58.         return $this->id;
  59.     }
  60.     public function getCreatedAt(): ?\DateTimeInterface
  61.     {
  62.         return $this->createdAt;
  63.     }
  64.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  65.     {
  66.         $this->createdAt $createdAt;
  67.         return $this;
  68.     }
  69.     public function getType()
  70.     {
  71.         return $this->type;
  72.     }
  73.     public function setType($type): self
  74.     {
  75.         $this->type $type;
  76.         return $this;
  77.     }
  78.     public function getPath(): ?string
  79.     {
  80.         return $this->path;
  81.     }
  82.     public function getFileName(): ?string
  83.     {
  84.         return basename($this->path);
  85.     }
  86.     public function setPath(string $path): self
  87.     {
  88.         $this->path $path;
  89.         return $this;
  90.     }
  91.     public function getOriginalHash(): ?string
  92.     {
  93.         return $this->originalHash;
  94.     }
  95.     public function setOriginalHash(?string $originalHash): self
  96.     {
  97.         $this->originalHash $originalHash;
  98.         return $this;
  99.     }
  100.     public function getCompressedHash(): ?string
  101.     {
  102.         return $this->compressedHash;
  103.     }
  104.     public function setCompressedHash(?string $compressedHash): self
  105.     {
  106.         $this->compressedHash $compressedHash;
  107.         return $this;
  108.     }
  109.     public function getOriginalFileName(): ?string
  110.     {
  111.         return $this->originalFileName;
  112.     }
  113.     public function setOriginalFileName(?string $originalFileName): self
  114.     {
  115.         $this->originalFileName $originalFileName;
  116.         return $this;
  117.     }
  118.     public function getReuploadsCount(): ?int
  119.     {
  120.         return $this->reuploadsCount;
  121.     }
  122.     public function setReuploadsCount(?int $reuploadsCount): self
  123.     {
  124.         $this->reuploadsCount $reuploadsCount;
  125.         return $this;
  126.     }
  127.     public function getSize(): ?int
  128.     {
  129.         return $this->size;
  130.     }
  131.     public function setSize(?int $size): self
  132.     {
  133.         $this->size $size;
  134.         return $this;
  135.     }
  136.     public function getUploadMinutes(): ?int
  137.     {
  138.         return $this->uploadMinutes;
  139.     }
  140.     public function setUploadMinutes(?int $uploadMinutes): self
  141.     {
  142.         $this->uploadMinutes $uploadMinutes;
  143.         return $this;
  144.     }
  145. }