<?php
namespace Boab\CmsBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* Document
*
* @ORM\Table(name="document")
* @ORM\Entity(repositoryClass="Boab\CmsBundle\Repository\ContentRepository")
*/
class Document extends Content implements DocumentInterface
{
/**
*/
/**
* @var string
*
* @ORM\Column(name="file_name", type="string", length=255, precision=0, scale=0, nullable=true, unique=false)
*
*/
private $fileName;
/**
* @var string
*
* @ORM\Column(name="extension", type="string", length=20, precision=0, scale=0, nullable=true, unique=false)
*
*/
private $extension;
private $document;
public function getUploadRoot():string
{
return 'assets/documents';
}
/**
* Set extension
*
* @param string $extension
*
* @return Document
*/
public function setExtension($extension)
{
$this->extension = $extension;
return $this;
}
/**
* Get extension
*
* @return string
*/
public function getExtension()
{
return $this->extension;
}
/**
* Get the value of fileName
*
* @return string
*/
public function getFileName()
{
return $this->fileName;
}
/**
* Set the value of fileName
*
* @param string $fileName
*
* @return self
*/
public function setFileName(string $fileName)
{
$this->fileName = $fileName;
return $this;
}
/**
* Get the value of document
*/
public function getDocument()
{
return $this->document;
}
/**
* Set the value of document
*
* @return self
*/
public function setDocument($document)
{
$this->document = $document;
return $this;
}
public function getDocumentPath()
{
return $this->getUploadRoot().'/'.$this->fileName;
}
}