<?php
namespace App\Entity\File;
use App\Entity\Product;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* @ORM\Entity
* @ORM\HasLifecycleCallbacks
*/
class ProductFile
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $deleted = false;
/**
* Order název souboru bych viděl jako Smlouva č.{order_id} v.{version} a u
* Product bych tam nahrával to jak to má pojmenovaný uživatel
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $fileType;
/**
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $linkText;
/**
*
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $sortOrder;
/**
* @ORM\Column(type="string", length=128, nullable=true)
*/
private $mime;
/**
* Technický název bych viděl v případě Order takto /public/files/contracts/{order_id}/{RAND_HASH}.pdf a
* V případě Product takto /public/files/templates/{product_id}/{RAND_HASH}.pdf
*
* @ORM\Column(type="string", length=512, nullable=true)
*/
private $url;
/**
* @ORM\Column(type="string", length=512, nullable=true)
*/
private $url_del;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $size;
/**
* @var UploadedFile
*/
private $uploadFile;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $signed = false;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $showOnWebsite = false;
/**
* @ORM\ManyToOne(targetEntity=Product::class, inversedBy="productFiles")
*/
private $product;
/**
* @return mixed
*/
public function getId()
{
return $this->id;
}
/**
* @return bool
*/
public function isShowOnWebsite(): bool
{
return (boolean)$this->showOnWebsite;
}
/**
* @param bool $showOnWebsite
*/
public function setShowOnWebsite(bool $showOnWebsite): self
{
$this->showOnWebsite = $showOnWebsite;
return $this;
}
/**
* @return mixed
*/
public function getFileType()
{
return $this->fileType;
}
/**
* @param mixed $fileType
*/
public function setFileType($fileType): void
{
$this->fileType = $fileType;
}
/**
* @return UploadedFile|null
*/
public function getUploadFile(): ?UploadedFile
{
return $this->uploadFile;
}
/**
* @param UploadedFile $uploadFile
*/
public function setUploadFile(UploadedFile $uploadFile): void
{
$this->uploadFile = $uploadFile;
}
/**
* @return mixed
*/
public function getLinkText()
{
return $this->linkText;
}
/**
* @param mixed $linkText
*/
public function setLinkText($linkText): void
{
$this->linkText = $linkText;
}
/**
* @return mixed
*/
public function getSortOrder()
{
return $this->sortOrder;
}
/**
* @param mixed $sortOrder
*/
public function setSortOrder($sortOrder): void
{
$this->sortOrder = $sortOrder;
}
public function getProduct(): ?Product
{
return $this->product;
}
public function setProduct(?Product $product): self
{
$this->product = $product;
return $this;
}
/**
* @return bool
*/
public function isDeleted(): bool
{
return $this->deleted;
}
/**
* @param bool $deleted
*/
public function setDeleted(bool $deleted): void
{
$this->deleted = $deleted;
}
/**
* @return mixed
*/
public function getName()
{
return $this->name;
}
/**
* @param mixed $name
*/
public function setName($name): self
{
$this->name = $name;
return $this;
}
/**
* @return mixed
*/
public function getMime()
{
return $this->mime;
}
/**
* @param mixed $mime
*/
public function setMime($mime): void
{
$this->mime = $mime;
}
/**
* @return mixed
*/
public function getUrl()
{
return $this->url;
}
/**
* @param mixed $url
*/
public function setUrl($url): self
{
$this->url = $url;
return $this;
}
/**
* @return mixed
*/
public function getUrlDel()
{
return $this->url_del;
}
/**
* @param mixed $url_del
*/
public function setUrlDel($url_del): self
{
$this->url_del = $url_del;
return $this;
}
/**
* @return mixed
*/
public function getSize()
{
return $this->size;
}
/**
* @param mixed $size
*/
public function setSize($size): self
{
$this->size = $size;
return $this;
}
/**
* @return bool
*/
public function isSigned(): bool
{
return $this->signed;
}
/**
* @param bool $signed
*/
public function setSigned(bool $signed): void
{
$this->signed = $signed;
}
}