lib/boab/cms-bundle/src/Entity/Audio.php line 14

Open in your IDE?
  1. <?php
  2. namespace Boab\CmsBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Boab\CmsBundle\Entity\Content;
  5. use Boab\CmsBundle\Entity\AudioInterface;
  6. /**
  7.  * Audio
  8.  * @ORM\Table(name="audio")
  9.  * @ORM\Entity(repositoryClass="Boab\CmsBundle\Repository\ContentRepository")
  10.  */
  11. class Audio extends Content implements AudioInterface
  12. {
  13.     /**
  14.      * @var string
  15.      *
  16.      * @ORM\Column(name="audio_file", type="string", length=255, precision=0, scale=0, nullable=true, unique=false)
  17.      */
  18.     private $audio;
  19.     /**
  20.      * @var string
  21.      *
  22.      * @ORM\Column(name="audio_author", type="string", length=255, precision=0, scale=0, nullable=false, unique=false)
  23.      */
  24.     private $author;    
  25.     /**
  26.      * Set audio
  27.      *
  28.      * @param string $audio
  29.      * @return Sermon
  30.      */
  31.     public function setAudio($audio=null)
  32.     {
  33.         if($audio != null ){
  34.             $this->audio $audio;
  35.         }
  36.         return $this;
  37.     }
  38.     /**
  39.      * Get audio
  40.      *
  41.      * @return string 
  42.      */
  43.     public function getAudio()
  44.     {
  45.         return $this->audio;
  46.     }
  47.     /**
  48.      * Set author
  49.      *
  50.      * @param string $author
  51.      *
  52.      * @return Audio
  53.      */
  54.     public function setAuthor($author)
  55.     {
  56.         $this->author $author;
  57.         return $this;
  58.     }
  59.     /**
  60.      * Get author
  61.      *
  62.      * @return string
  63.      */
  64.     public function getAuthor()
  65.     {
  66.         return $this->author;
  67.     }  
  68.     public function getUploadRoot(): string
  69.     {
  70.         return sprintf('%s/%s'parent::getUploadRoot(), $this->getId());
  71.     }  
  72.     public function getAudioUrlPath()
  73.     {
  74.         return sprintf('%s/%s/%s'parent::getUploadRoot(), $this->getId(), $this->getAudio());
  75.     }        
  76.     
  77. }