src/Entity/File.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\FileRepository;
  4. use App\Services\File\FileService;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassFileRepository::class)]
  8. class File
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private ?int $id;
  14.     #[ORM\Column(type'string'length30)]
  15.     private ?string $service;
  16.     #[ORM\Column(type'string'length20)]
  17.     private ?string $fileType;
  18.     #[ORM\Column(type'string'length100)]
  19.     private ?string $mimeType;
  20.     #[ORM\Column(type'string'length1000)]
  21.     private ?string $name;
  22.     #[ORM\Column(type'string'length1000)]
  23.     private ?string $fileName;
  24.     #[ORM\Column(type'datetime'nullablefalse)]
  25.     private ?\DateTimeInterface $timeUploaded;
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getService(): ?string
  31.     {
  32.         return $this->service;
  33.     }
  34.     public function setService(string $service): self
  35.     {
  36.         $this->service $service;
  37.         return $this;
  38.     }
  39.     public function getFullPath() {
  40.         return "/" FileService::CONTENT_DIR .
  41.             "/" $this->service .
  42.             "/" $this->fileType .
  43.             "/" $this->timeUploaded->format(FileService::TIME_INTERVAL_FORMAT) .
  44.             "/" $this->fileName
  45.             ;
  46.     }
  47.     public function getFileType(): ?string
  48.     {
  49.         return $this->fileType;
  50.     }
  51.     public function setFileType(string $fileType): self
  52.     {
  53.         $this->fileType $fileType;
  54.         return $this;
  55.     }
  56.     public function getMimeType(): ?string
  57.     {
  58.         return $this->mimeType;
  59.     }
  60.     public function setMimeType(string $mimeType): self
  61.     {
  62.         $this->mimeType $mimeType;
  63.         return $this;
  64.     }
  65.     public function getName(): ?string
  66.     {
  67.         return $this->name;
  68.     }
  69.     public function setName(string $name): self
  70.     {
  71.         $this->name $name;
  72.         return $this;
  73.     }
  74.     public function getFileName(): ?string
  75.     {
  76.         return $this->fileName;
  77.     }
  78.     public function setFileName(string $fileName): self
  79.     {
  80.         $this->fileName $fileName;
  81.         return $this;
  82.     }
  83.     public function getTimeUploaded(): ?\DateTimeInterface
  84.     {
  85.         return $this->timeUploaded;
  86.     }
  87.     public function setTimeUploaded(\DateTimeInterface $timeUploaded): self
  88.     {
  89.         $this->timeUploaded $timeUploaded;
  90.         return $this;
  91.     }
  92. }