src/Entity/Video.php line 13
<?phpnamespace App\Entity;use App\Repository\VideoRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;#[ORM\Entity(repositoryClass: VideoRepository::class)]class Video{const STATUS_CREATED = 0;const STATUS_ACTIVE = 1;const STATUS_PROCESSING = 2;const STATUS_INACTIVE = 3;const STATUS_LOCKED = 4;const STATUS_ERROR = 5;#[Groups(['main'])]#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[Groups(['main'])]#[ORM\Column(type: Types::SMALLINT)]private int $status = self::STATUS_CREATED;#[Groups(['main'])]#[ORM\Column(length: 255)]private string $title = '';#[Groups(['main'])]#[ORM\Column(type: Types::TEXT)]private string $description = '';#[Groups(['main'])]#[ORM\Column(type: Types::SMALLINT)]private int $source = 0;#[Groups(['main'])]#[ORM\Column(type: Types::SMALLINT)]private int $year = 0;#[Groups(['main'])]#[ORM\Column(type: Types::SMALLINT)]private int $length = 0;#[ORM\ManyToMany(targetEntity: Tag::class, inversedBy: 'videos')]#[ORM\OrderBy(['name' => 'ASC'])]private Collection $tags;#[ORM\OneToMany(mappedBy: 'video', targetEntity: VideoImage::class)]private Collection $images;#[ORM\ManyToMany(targetEntity: Actor::class, inversedBy: 'videos')]private Collection $actors;#[Groups(['main'])]#[ORM\OneToOne(cascade: ['persist', 'remove'])]private ?VideoImage $front_image = null;#[ORM\Column(length: 255)]private string $filename = '';#[Groups(['main'])]#[ORM\ManyToOne(inversedBy: 'videos')]private ?Studio $studio = null;public function __construct(){$this->tags = new ArrayCollection();$this->images = new ArrayCollection();$this->actors = new ArrayCollection();}public function getId(): ?int{return $this->id;}public function getStatus(): ?int{return $this->status;}public function setStatus(int $status): self{$this->status = $status;return $this;}public function getTitle(): ?string{return $this->title;}public function setTitle(string $title): self{$this->title = $title;return $this;}public function getDescription(): ?string{return $this->description;}public function setDescription(string $description): self{$this->description = $description;return $this;}public function getSource(): ?int{return $this->source;}public function setSource(int $source): self{$this->source = $source;return $this;}public function getYear(): ?int{return $this->year;}public function setYear(int $year): self{$this->year = $year;return $this;}public function getLength(): ?int{return $this->length;}public function setLength(int $length): self{$this->length = $length;return $this;}/*** @return Collection<int, tag>*/public function getTags(): Collection{return $this->tags;}public function addTag(tag $tag): self{if (!$this->tags->contains($tag)) {$this->tags->add($tag);}return $this;}public function removeTag(tag $tag): self{$this->tags->removeElement($tag);return $this;}/*** @return Collection<int, VideoImage>*/public function getImages(): Collection{return $this->images;}public function addImage(VideoImage $image): self{if (!$this->images->contains($image)) {$this->images->add($image);$image->setVideo($this);}return $this;}public function removeImage(VideoImage $image): self{if ($this->images->removeElement($image)) {// set the owning side to null (unless already changed)if ($image->getVideo() === $this) {$image->setVideo(null);}}return $this;}/*** @return Collection<int, Actor>*/public function getActors(): Collection{return $this->actors;}public function addActor(Actor $actor): self{if (!$this->actors->contains($actor)) {$this->actors->add($actor);}return $this;}public function removeActor(Actor $actor): self{$this->actors->removeElement($actor);return $this;}public function getFrontImage(): ?VideoImage{return $this->front_image;}public function setFrontImage(?VideoImage $front_image): self{$this->front_image = $front_image;return $this;}public function getFilename(): ?string{return $this->filename;}public function setFilename(string $filename): self{$this->filename = $filename;return $this;}public function getStudio(): ?Studio{return $this->studio;}public function setStudio(?Studio $studio): self{$this->studio = $studio;return $this;}}