<?php
namespace App\Entity;
use App\Entity\SuperClass\BaseEntity;
use App\Repository\MediaObjectRepository;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\HttpFoundation\File\File;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
/**
* @ORM\Entity(repositoryClass=MediaObjectRepository::class)
* @Vich\Uploadable
*/
class MediaObject extends BaseEntity
{
/**
* @Vich\UploadableField(mapping="media_object", fileNameProperty="filepath" , size="imageSize")
*/
private $file;
/**
* @ORM\Column(type="string", length=255)
*/
private $filepath;
/**
* @var string
*/
public ?string $contentUrl;
/**
* @ORM\Column(type="integer")
*/
private ?int $imageSize;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="mediaObjects")
*/
private $created_by;
public function getId(): ?int
{
return $this->id;
}
public function getFile(): ?File
{
return $this->file;
}
public function setFile(File $file): self
{
$this->file = $file;
return $this;
}
public function getFilepath(): ?string
{
return $this->filepath;
}
public function setFilepath(string $filepath): self
{
$this->filepath = $filepath;
return $this;
}
public function getCreatedBy(): ?User
{
return $this->created_by;
}
public function setCreatedBy(?User $created_by): self
{
$this->created_by = $created_by;
return $this;
}
public function setImageSize(int $imageSize): self
{
$this->imageSize = $imageSize;
return $this;
}
public function getImageSize(): ?int
{
return $this->imageSize;
}
public function setContentUrl(?string $contentUrl): self
{
$this->contentUrl = $contentUrl;
return $this;
}
public function getContentUrl(): ?string
{
return $this->contentUrl;
}
}