src/Entity/Media.php line 11

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\MediaRepository;
  4. use Doctrine\DBAL\Types\Types;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Gedmo\Mapping\Annotation as Gedmo;
  7. #[ORM\Entity(repositoryClassMediaRepository::class)]
  8. class Media
  9. {
  10.     const TYPE_PODCAST "podcast";
  11.     const TYPE_TESTIMONY "testimony";
  12.     
  13.     static public function getTypeOptions()
  14.     {
  15.         return [
  16.             'Podcast' => self::TYPE_PODCAST,
  17.             'Úwiadectwo' => self::TYPE_TESTIMONY,
  18.         ];
  19.     }
  20.     
  21.     #[ORM\Id]
  22.     #[ORM\GeneratedValue]
  23.     #[ORM\Column]
  24.     private ?int $id null;
  25.     #[ORM\Column(length255)]
  26.     #[Gedmo\SortableGroup]
  27.     private ?string $type null;
  28.     #[ORM\Column(length255)]
  29.     private ?string $title null;
  30.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  31.     private ?string $description null;
  32.     #[ORM\Column(length255)]
  33.     private ?string $link null;
  34.     #[ORM\Column]
  35.     private ?bool $active null;
  36.     #[ORM\Column]
  37.     #[Gedmo\SortablePosition]
  38.     private ?int $position null;
  39.     #[ORM\Column(length255nullabletrue)]
  40.     private ?string $subtitles null;
  41.     #[ORM\Column(length255nullabletrue)]
  42.     private ?string $image null;
  43.     #[ORM\Column(length255nullabletrue)]
  44.     private ?string $parameter null;
  45.     #[ORM\Column(length255nullabletrue)]
  46.     private ?string $podcast null;
  47.     public function clone(): Media
  48.     {
  49.         $new = new Media();
  50.         $new->setType($this->type);
  51.         $new->setTitle($this->title);
  52.         $new->setDescription($this->description);
  53.         $new->setLink($this->link);
  54.         $new->setActive($this->active);
  55.         $new->setPosition(-1);
  56.         $new->setSubtitles($this->subtitles);
  57.         $new->setImage($this->image);
  58.         $new->setParameter($this->parameter);
  59.         $new->setPodcast($this->podcast);
  60.         
  61.         return $new;
  62.     }
  63.     public function getId(): ?int
  64.     {
  65.         return $this->id;
  66.     }
  67.     public function getType(): ?string
  68.     {
  69.         return $this->type;
  70.     }
  71.     public function setType(string $type): self
  72.     {
  73.         $this->type $type;
  74.         return $this;
  75.     }
  76.     public function getTitle(): ?string
  77.     {
  78.         return $this->title;
  79.     }
  80.     public function setTitle(string $title): self
  81.     {
  82.         $this->title $title;
  83.         return $this;
  84.     }
  85.     public function getDescription(): ?string
  86.     {
  87.         return $this->description;
  88.     }
  89.     public function setDescription(?string $description): self
  90.     {
  91.         $this->description $description;
  92.         return $this;
  93.     }
  94.     public function getLink(): ?string
  95.     {
  96.         return ($this->link $this->link '');
  97.     }
  98.     public function setLink(string $link): self
  99.     {
  100.         $this->link $link;
  101.         return $this;
  102.     }
  103.     public function isActive(): ?bool
  104.     {
  105.         return $this->active;
  106.     }
  107.     public function setActive(bool $active): self
  108.     {
  109.         $this->active $active;
  110.         return $this;
  111.     }
  112.     public function getPosition(): ?int
  113.     {
  114.         return $this->position;
  115.     }
  116.     public function setPosition(int $position = -1): self
  117.     {
  118.         $this->position $position;
  119.         return $this;
  120.     }
  121.     public function getSubtitles(): ?string
  122.     {
  123.         return ($this->subtitles $this->subtitles '');
  124.     }
  125.     public function setSubtitles(?string $subtitles): self
  126.     {
  127.         $this->subtitles $subtitles;
  128.         return $this;
  129.     }
  130.     public function getImage(): ?string
  131.     {
  132.         return ($this->image $this->image '');
  133.     }
  134.     public function setImage(?string $image): self
  135.     {
  136.         $this->image $image;
  137.         return $this;
  138.     }
  139.     public function getParameter(): ?string
  140.     {
  141.         return $this->parameter;
  142.     }
  143.     public function setParameter(?string $parameter): self
  144.     {
  145.         $this->parameter $parameter;
  146.         return $this;
  147.     }
  148.         public function getPodcast(): ?string
  149.     {
  150.         return $this->podcast;
  151.     }
  152.     public function setPodcast(?string $podcast): self
  153.     {
  154.         $this->podcast $podcast;
  155.         return $this;
  156.     }
  157. }