src/Entity/Media.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MediaRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\HttpFoundation\File\File;
  6. use Vich\UploaderBundle\Mapping\Annotation as Vich;
  7. /**
  8.  * @ORM\Entity(repositoryClass=MediaRepository::class)
  9.  * @Vich\Uploadable
  10.  */
  11. class Media
  12. {
  13.     /**
  14.      * @ORM\Id
  15.      * @ORM\GeneratedValue
  16.      * @ORM\Column(type="integer")
  17.      */
  18.     private $id;
  19.     /**
  20.      * @Vich\UploadableField(mapping="posts", fileNameProperty="filePath")
  21.      * @var File|null
  22.      */
  23.     private $file;
  24.     /**
  25.      * @ORM\Column(type="string", length=255, nullable=true)
  26.      */
  27.     private $type;
  28.     /**
  29.      * @ORM\Column(type="string", length=255)
  30.      */
  31.     private $filePath;
  32.     public function getId(): ?int
  33.     {
  34.         return $this->id;
  35.     }
  36.     public function getType(): ?string
  37.     {
  38.         return $this->type;
  39.     }
  40.     public function setType(?string $type): self
  41.     {
  42.         $this->type $type;
  43.         return $this;
  44.     }
  45.     /**
  46.      * @return mixed
  47.      */
  48.     public function getFile() : ?File
  49.     {
  50.         return $this->file;
  51.     }
  52.     /**
  53.      * @param mixed $file
  54.      */
  55.     public function setFile(?File $file): void
  56.     {
  57.         $this->file $file;
  58.     }
  59.     public function getFilePath(): ?string
  60.     {
  61.         return $this->filePath;
  62.     }
  63.     public function setFilePath(?string $filePath): void
  64.     {
  65.         $this->filePath $filePath;
  66.     }
  67. }