<?php
namespace App\Entity;
use App\Repository\TranslatedCourseRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: TranslatedCourseRepository::class)]
class TranslatedCourse
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'string', length: 255)]
private $name;
#[ORM\Column(type: 'text', nullable: true)]
private $description;
#[ORM\ManyToOne(targetEntity: Course::class, inversedBy: 'translatedContents')]
private $course;
#[ORM\Column(type: 'string', length: 255)]
private $language;
#[ORM\OneToMany(targetEntity: Planning::class, mappedBy: 'translatedCourse', orphanRemoval: true, cascade: ['persist', 'remove'])]
private $plannings;
#[ORM\Column(type: 'string', length: 255, nullable: true)]
private $others;
public function __construct()
{
$this->plannings = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getCourse(): ?Course
{
return $this->course;
}
public function setCourse(?Course $course): self
{
$this->course = $course;
return $this;
}
public function getLanguage(): ?string
{
return $this->language;
}
public function setLanguage(string $language): self
{
$this->language = $language;
return $this;
}
/**
* @return Collection|Planning[]
*/
public function getPlannings(): Collection
{
return $this->plannings;
}
public function addPlanning(Planning $planning): self
{
if (!$this->plannings->contains($planning)) {
$this->plannings[] = $planning;
$planning->setTranslatedCourse($this);
}
return $this;
}
public function removePlanning(Planning $planning): self
{
if ($this->plannings->removeElement($planning)) {
// set the owning side to null (unless already changed)
if ($planning->getTranslatedCourse() === $this) {
$planning->setTranslatedCourse(null);
}
}
return $this;
}
public function getOthers(): ?string
{
return $this->others;
}
public function setOthers(?string $others): self
{
$this->others = $others;
return $this;
}
}