src/Entity/Course.php line 14
<?phpnamespace App\Entity;use ApiPlatform\Metadata\ApiResource;use App\Repository\CourseRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CourseRepository::class)]#[ApiResource]class Course{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(type: Types::TEXT)]private ?string $description = null;#[ORM\ManyToMany(targetEntity: Catalog::class, inversedBy: 'courses')]private Collection $catalog;#[ORM\ManyToOne(inversedBy: 'courses')]private ?CourseTag $courseTag = null;#[ORM\ManyToMany(targetEntity: Attendee::class, inversedBy: 'courses')]private Collection $attendees;#[ORM\Column]private ?\DateTimeImmutable $createdAt = null;#[ORM\Column]private ?bool $isPublished = null;#[ORM\ManyToOne(inversedBy: 'courses')]private ?MediaObject $mainImage = null;#[ORM\OneToMany(mappedBy: 'course', targetEntity: Lesson::class, cascade: ['persist'],orphanRemoval: true)]private Collection $lessons;#[ORM\OneToMany(mappedBy: 'course', targetEntity: CourseEvaluation::class, cascade: ['persist'])]private Collection $courseEvaluations;#[ORM\OneToMany(mappedBy: 'course', targetEntity: GivenAnswere::class, cascade: ['persist'])]private Collection $givenAnsweres;#[ORM\ManyToMany(targetEntity: CourseLicense::class, mappedBy: 'courses', cascade: ['persist'])]private Collection $courseLicenses;#[ORM\Column]private ?bool $abo = null;#[ORM\Column]private ?int $abotime = 0;#[ORM\OneToMany(mappedBy: 'course', targetEntity: PraxisLesson::class)]private Collection $praxisLessons;#[ORM\Column(nullable: true)]private ?bool $evaluation = null;#[ORM\ManyToOne(inversedBy: 'courses')]private ?PortalAdministrator $portalAdmin = null;#[ORM\Column]private ?bool $generateCert = null;#[ORM\Column(type: Types::TEXT)]private ?string $certDescription = null;#[ORM\OneToMany(mappedBy: 'course', targetEntity: Certificate::class)]private Collection $certificates;public function __construct(){$this->catalog = new ArrayCollection();$this->attendees = new ArrayCollection();$this->createdAt = new \DateTimeImmutable();$this->lessons = new ArrayCollection();$this->courseEvaluations = new ArrayCollection();$this->givenAnsweres = new ArrayCollection();$this->courseLicenses = new ArrayCollection();$this->setDescription('Beschreibung');$this->praxisLessons = new ArrayCollection();$this->certificates = new ArrayCollection();}public function __toString(): string{return $this->name;}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;}/*** @return Collection<int, Catalog>*/public function getCatalog(): Collection{return $this->catalog;}public function addCatalog(Catalog $catalog): self{if (!$this->catalog->contains($catalog)) {$this->catalog->add($catalog);}return $this;}public function removeCatalog(Catalog $catalog): self{$this->catalog->removeElement($catalog);return $this;}public function getCourseTag(): ?CourseTag{return $this->courseTag;}public function setCourseTag(?CourseTag $courseTag): self{$this->courseTag = $courseTag;return $this;}/*** @return Collection<int, Attendee>*/public function getAttendees(): Collection{return $this->attendees;}public function addAttendee(Attendee $attendee): self{if (!$this->attendees->contains($attendee)) {$this->attendees->add($attendee);}return $this;}public function removeAttendee(Attendee $attendee): self{$this->attendees->removeElement($attendee);return $this;}public function getCreatedAt(): ?\DateTimeImmutable{return $this->createdAt;}public function setCreatedAt(\DateTimeImmutable $createdAt): self{$this->createdAt = $createdAt;return $this;}public function isIsPublished(): ?bool{return $this->isPublished;}public function setIsPublished(bool $isPublished): self{$this->isPublished = $isPublished;return $this;}public function getMainImage(): ?MediaObject{return $this->mainImage;}public function setMainImage(?MediaObject $mainImage): self{$this->mainImage = $mainImage;return $this;}/*** @return Collection<int, Lesson>*/public function getLessons(): Collection{return $this->lessons;}public function addLesson(Lesson $lesson): self{if (!$this->lessons->contains($lesson)) {$this->lessons->add($lesson);$lesson->setCourse($this);}return $this;}public function removeLesson(Lesson $lesson): self{if ($this->lessons->removeElement($lesson)) {// set the owning side to null (unless already changed)if ($lesson->getCourse() === $this) {$lesson->setCourse(null);}}return $this;}/*** @return Collection<int, CourseEvaluation>*/public function getCourseEvaluations(): Collection{return $this->courseEvaluations;}public function addCourseEvaluation(CourseEvaluation $courseEvaluation): self{if (!$this->courseEvaluations->contains($courseEvaluation)) {$this->courseEvaluations->add($courseEvaluation);$courseEvaluation->setCourse($this);}return $this;}public function removeCourseEvaluation(CourseEvaluation $courseEvaluation): self{if ($this->courseEvaluations->removeElement($courseEvaluation)) {// set the owning side to null (unless already changed)if ($courseEvaluation->getCourse() === $this) {$courseEvaluation->setCourse(null);}}return $this;}/*** @return Collection<int, GivenAnswere>*/public function getGivenAnsweres(): Collection{return $this->givenAnsweres;}public function addGivenAnswere(GivenAnswere $givenAnswere): self{if (!$this->givenAnsweres->contains($givenAnswere)) {$this->givenAnsweres->add($givenAnswere);$givenAnswere->setCourse($this);}return $this;}public function removeGivenAnswere(GivenAnswere $givenAnswere): self{if ($this->givenAnsweres->removeElement($givenAnswere)) {// set the owning side to null (unless already changed)if ($givenAnswere->getCourse() === $this) {$givenAnswere->setCourse(null);}}return $this;}/*** @return Collection<int, CourseLicense>*/public function getCourseLicenses(): Collection{return $this->courseLicenses;}public function addCourseLicense(CourseLicense $courseLicense): self{if (!$this->courseLicenses->contains($courseLicense)) {$this->courseLicenses->add($courseLicense);$courseLicense->addCourse($this);}return $this;}public function removeCourseLicense(CourseLicense $courseLicense): self{if ($this->courseLicenses->removeElement($courseLicense)) {$courseLicense->removeCourse($this);}return $this;}public function isAbo(): ?bool{return $this->abo;}public function setAbo(bool $abo): self{$this->abo = $abo;return $this;}public function getAbotime(): ?int{return $this->abotime;}public function setAbotime(int $abotime): self{$this->abotime = $abotime;return $this;}/*** @return Collection<int, PraxisLesson>*/public function getPraxisLessons(): Collection{return $this->praxisLessons;}public function addPraxisLesson(PraxisLesson $praxisLesson): self{if (!$this->praxisLessons->contains($praxisLesson)) {$this->praxisLessons->add($praxisLesson);$praxisLesson->setCourse($this);}return $this;}public function removePraxisLesson(PraxisLesson $praxisLesson): self{if ($this->praxisLessons->removeElement($praxisLesson)) {// set the owning side to null (unless already changed)if ($praxisLesson->getCourse() === $this) {$praxisLesson->setCourse(null);}}return $this;}public function isEvaluation(): ?bool{return $this->evaluation;}public function setEvaluation(?bool $evaluation): self{$this->evaluation = $evaluation;return $this;}public function getPortalAdmin(): ?PortalAdministrator{return $this->portalAdmin;}public function setPortalAdmin(?PortalAdministrator $portalAdmin): self{$this->portalAdmin = $portalAdmin;return $this;}public function isGenerateCert(): ?bool{return $this->generateCert;}public function setGenerateCert(bool $generateCert): self{$this->generateCert = $generateCert;return $this;}public function getCertDescription(): ?string{return $this->certDescription;}public function setCertDescription(string $certDescription): self{$this->certDescription = $certDescription;return $this;}/*** @return Collection<int, Certificate>*/public function getCertificates(): Collection{return $this->certificates;}public function addCertificate(Certificate $certificate): self{if (!$this->certificates->contains($certificate)) {$this->certificates->add($certificate);$certificate->setCourse($this);}return $this;}public function removeCertificate(Certificate $certificate): self{if ($this->certificates->removeElement($certificate)) {// set the owning side to null (unless already changed)if ($certificate->getCourse() === $this) {$certificate->setCourse(null);}}return $this;}}