src/Entity/Videos.php line 13

  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8.  * @ORM\Entity(repositoryClass="App\Repository\VideosRepository")
  9.  */
  10. class Videos extends OSEntity
  11. {
  12.     /**
  13.      * @ORM\Column(name="youtube", type="string", length=255, nullable=true)
  14.      */
  15.     private $youtube;
  16.     /**
  17.      * @ORM\OneToOne(targetEntity="App\Entity\File", cascade={"persist","remove"}, orphanRemoval=true)
  18.      * @ORM\JoinColumn(nullable=true)
  19.      */
  20.     private $file;
  21.     /**
  22.      * @ORM\OneToOne(targetEntity="App\Entity\Biblios", cascade={"persist","remove"}, orphanRemoval=true)
  23.      * @ORM\JoinColumn(nullable=true)
  24.      */
  25.     private $biblio;
  26.     /**
  27.      * @ORM\ManyToOne(targetEntity="App\Entity\VideosCategories", fetch="EAGER")
  28.      * @ORM\JoinColumn(nullable=true)
  29.      */
  30.     private $category;
  31.     public function getYoutube(): ?string
  32.     {
  33.         return $this->youtube;
  34.     }
  35.     public function setYoutube(?string $youtube): self
  36.     {
  37.         $this->youtube $youtube;
  38.         return $this;
  39.     }
  40.     public function getFile(): ?File
  41.     {
  42.         return $this->file;
  43.     }
  44.     public function setFile(?File $file): self
  45.     {
  46.         if($file->getTarget()){
  47.             $this->file $file;
  48.             $this->file->setDir('upload/videos');
  49.         }
  50.         return $this;
  51.     }
  52.     public function getBiblio(): ?Biblios
  53.     {
  54.         return $this->biblio;
  55.     }
  56.     public function setBiblio(?Biblios $biblio): self
  57.     {
  58.         $this->biblio $biblio;
  59.         return $this;
  60.     }
  61.     public function getCategory(): ?VideosCategories
  62.     {
  63.         return $this->category;
  64.     }
  65.     public function setCategory(?VideosCategories $category): self
  66.     {
  67.         $this->category $category;
  68.         return $this;
  69.     }
  70. }