<?php
namespace App\Entity;
use App\Repository\CategorieVideoRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: CategorieVideoRepository::class)]
class CategorieVideo
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $libelle;
#[ORM\OneToMany(targetEntity: Video::class, mappedBy: 'categorie')]
private $video;
public function __construct()
{
$this->video = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getLibelle(): ?string
{
return $this->libelle;
}
public function setLibelle(string $libelle): self
{
$this->libelle = $libelle;
return $this;
}
/**
* @return Collection|Video[]
*/
public function getVideo(): Collection
{
return $this->video;
}
public function addVideo(Video $video): self
{
if (!$this->video->contains($video)) {
$this->video[] = $video;
$video->setCategorie($this);
}
return $this;
}
public function removeVideo(Video $video): self
{
if ($this->video->contains($video)) {
$this->video->removeElement($video);
// set the owning side to null (unless already changed)
if ($video->getCategorie() === $this) {
$video->setCategorie(null);
}
}
return $this;
}
}