src/Entity/TranslatedCourse.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\TranslatedCourseRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Entity(repositoryClassTranslatedCourseRepository::class)]
  8. class TranslatedCourse
  9. {
  10.     #[ORM\Id]
  11.     #[ORM\GeneratedValue]
  12.     #[ORM\Column(type'integer')]
  13.     private $id;
  14.     #[ORM\Column(type'string'length255)]
  15.     private $name;
  16.     #[ORM\Column(type'text'nullabletrue)]
  17.     private $description;
  18.     #[ORM\ManyToOne(targetEntityCourse::class, inversedBy'translatedContents')]
  19.     private $course;
  20.     #[ORM\Column(type'string'length255)]
  21.     private $language;
  22.     #[ORM\OneToMany(targetEntityPlanning::class, mappedBy'translatedCourse'orphanRemovaltruecascade: ['persist''remove'])]
  23.     private $plannings;
  24.     #[ORM\Column(type'string'length255nullabletrue)]
  25.     private $others;
  26.     public function __construct()
  27.     {
  28.         $this->plannings = new ArrayCollection();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getName(): ?string
  35.     {
  36.         return $this->name;
  37.     }
  38.     public function setName(string $name): self
  39.     {
  40.         $this->name $name;
  41.         return $this;
  42.     }
  43.     public function getDescription(): ?string
  44.     {
  45.         return $this->description;
  46.     }
  47.     public function setDescription(string $description): self
  48.     {
  49.         $this->description $description;
  50.         return $this;
  51.     }
  52.     public function getCourse(): ?Course
  53.     {
  54.         return $this->course;
  55.     }
  56.     public function setCourse(?Course $course): self
  57.     {
  58.         $this->course $course;
  59.         return $this;
  60.     }
  61.     public function getLanguage(): ?string
  62.     {
  63.         return $this->language;
  64.     }
  65.     public function setLanguage(string $language): self
  66.     {
  67.         $this->language $language;
  68.         return $this;
  69.     }
  70.     /**
  71.      * @return Collection|Planning[]
  72.      */
  73.     public function getPlannings(): Collection
  74.     {
  75.         return $this->plannings;
  76.     }
  77.     public function addPlanning(Planning $planning): self
  78.     {
  79.         if (!$this->plannings->contains($planning)) {
  80.             $this->plannings[] = $planning;
  81.             $planning->setTranslatedCourse($this);
  82.         }
  83.         return $this;
  84.     }
  85.     public function removePlanning(Planning $planning): self
  86.     {
  87.         if ($this->plannings->removeElement($planning)) {
  88.             // set the owning side to null (unless already changed)
  89.             if ($planning->getTranslatedCourse() === $this) {
  90.                 $planning->setTranslatedCourse(null);
  91.             }
  92.         }
  93.         return $this;
  94.     }
  95.     public function getOthers(): ?string
  96.     {
  97.         return $this->others;
  98.     }
  99.     public function setOthers(?string $others): self
  100.     {
  101.         $this->others $others;
  102.         return $this;
  103.     }
  104. }