<?phpnamespace App\Entity;use App\Repository\VideoRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: VideoRepository::class)]class Video{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 150)] private ?string $nameVideo = null; #[ORM\Column(length: 255)] private ?string $urlVideo = null; #[ORM\ManyToMany(targetEntity: User::class, mappedBy: 'video')] private Collection $users; #[ORM\ManyToMany(targetEntity: Program::class, inversedBy: 'videos')] private Collection $program; public function __construct() { $this->users = new ArrayCollection(); $this->program = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getNameVideo(): ?string { return $this->nameVideo; } public function setNameVideo(string $nameVideo): self { $this->nameVideo = $nameVideo; return $this; } public function getUrlVideo(): ?string { return $this->urlVideo; } public function setUrlVideo(string $urlVideo): self { $this->urlVideo = $urlVideo; return $this; } /** * @return Collection<int, User> */ public function getUsers(): Collection { return $this->users; } public function addUser(User $user): self { if (!$this->users->contains($user)) { $this->users->add($user); $user->addVideo($this); } return $this; } public function removeUser(User $user): self { if ($this->users->removeElement($user)) { $user->removeVideo($this); } return $this; } /** * @return Collection<int, Program> */ public function getProgram(): Collection { return $this->program; } public function addProgram(Program $program): self { if (!$this->program->contains($program)) { $this->program->add($program); } return $this; } public function removeProgram(Program $program): self { $this->program->removeElement($program); return $this; }}