src/Entity/PraxisLesson.php line 14

  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Metadata\ApiResource;
  4. use App\Repository\PraxisLessonRepository;
  5. use Doctrine\DBAL\Types\Types;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\UX\Turbo\Attribute\Broadcast;
  8. #[ORM\Entity(repositoryClassPraxisLessonRepository::class)]
  9. #[ApiResource]
  10. #[Broadcast]
  11. class PraxisLesson
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255)]
  18.     private ?string $name null;
  19.     #[ORM\Column(typeTypes::TEXT)]
  20.     private ?string $description null;
  21.     #[ORM\Column]
  22.     private ?int $maxAttendees null;
  23.     #[ORM\Column(length255)]
  24.     private ?string $location null;
  25.     #[ORM\ManyToOne(inversedBy'praxisLessons')]
  26.     private ?Course $course null;
  27.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  28.     private ?\DateTimeInterface $date null;
  29.     public function __construct()
  30.     {
  31.         $this->setDate(new \DateTime());
  32.     }
  33.     public function __toString(): string
  34.     {
  35.         return $this->name.' - '.$this->date->format('d.m.Y');
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getName(): ?string
  42.     {
  43.         return $this->name;
  44.     }
  45.     public function setName(string $name): self
  46.     {
  47.         $this->name $name;
  48.         return $this;
  49.     }
  50.     public function getDescription(): ?string
  51.     {
  52.         return $this->description;
  53.     }
  54.     public function setDescription(string $description): self
  55.     {
  56.         $this->description $description;
  57.         return $this;
  58.     }
  59.     public function getMaxAttendees(): ?int
  60.     {
  61.         return $this->maxAttendees;
  62.     }
  63.     public function setMaxAttendees(int $maxAttendees): self
  64.     {
  65.         $this->maxAttendees $maxAttendees;
  66.         return $this;
  67.     }
  68.     public function getLocation(): ?string
  69.     {
  70.         return $this->location;
  71.     }
  72.     public function setLocation(string $location): self
  73.     {
  74.         $this->location $location;
  75.         return $this;
  76.     }
  77.     public function getCourse(): ?Course
  78.     {
  79.         return $this->course;
  80.     }
  81.     public function setCourse(?Course $course): self
  82.     {
  83.         $this->course $course;
  84.         return $this;
  85.     }
  86.     public function getDate(): ?\DateTimeInterface
  87.     {
  88.         return $this->date;
  89.     }
  90.     public function setDate(\DateTimeInterface $date): self
  91.     {
  92.         $this->date $date;
  93.         return $this;
  94.     }
  95.    
  96. }