<?php
namespace App\Entity;
use App\Repository\MediaRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass=MediaRepository::class)
* @Vich\Uploadable
*/
class Media
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @Vich\UploadableField(mapping="posts", fileNameProperty="filePath")
* @var File|null
*/
private $file;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $type;
/**
* @ORM\Column(type="string", length=255)
*/
private $filePath;
public function getId(): ?int
{
return $this->id;
}
public function getType(): ?string
{
return $this->type;
}
public function setType(?string $type): self
{
$this->type = $type;
return $this;
}
/**
* @return mixed
*/
public function getFile() : ?File
{
return $this->file;
}
/**
* @param mixed $file
*/
public function setFile(?File $file): void
{
$this->file = $file;
}
public function getFilePath(): ?string
{
return $this->filePath;
}
public function setFilePath(?string $filePath): void
{
$this->filePath = $filePath;
}
}