<?php
namespace Boab\CmsBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Boab\CmsBundle\Entity\Content;
use Boab\CmsBundle\Entity\AudioInterface;
/**
* Audio
* @ORM\Table(name="audio")
* @ORM\Entity(repositoryClass="Boab\CmsBundle\Repository\ContentRepository")
*/
class Audio extends Content implements AudioInterface
{
/**
* @var string
*
* @ORM\Column(name="audio_file", type="string", length=255, precision=0, scale=0, nullable=true, unique=false)
*/
private $audio;
/**
* @var string
*
* @ORM\Column(name="audio_author", type="string", length=255, precision=0, scale=0, nullable=false, unique=false)
*/
private $author;
/**
* Set audio
*
* @param string $audio
* @return Sermon
*/
public function setAudio($audio=null)
{
if($audio != null ){
$this->audio = $audio;
}
return $this;
}
/**
* Get audio
*
* @return string
*/
public function getAudio()
{
return $this->audio;
}
/**
* Set author
*
* @param string $author
*
* @return Audio
*/
public function setAuthor($author)
{
$this->author = $author;
return $this;
}
/**
* Get author
*
* @return string
*/
public function getAuthor()
{
return $this->author;
}
public function getUploadRoot(): string
{
return sprintf('%s/%s', parent::getUploadRoot(), $this->getId());
}
public function getAudioUrlPath()
{
return sprintf('%s/%s/%s', parent::getUploadRoot(), $this->getId(), $this->getAudio());
}
}