src/Entity/Core/Topic/TopicPerformance.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Core\Topic;
  3. use App\Entity\User\User;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Doctrine\ORM\Mapping\Column;
  6. use Doctrine\ORM\Mapping\ManyToOne;
  7. #[ORM\Table('topic_performance')]
  8. #[ORM\Entity(repositoryClass: TopicPerformanceRepository::class)]
  9. class TopicPerformance
  10. {
  11. #[Column(type: 'integer')]
  12. #[ORM\Id]
  13. #[ORM\GeneratedValue(strategy: 'AUTO')]
  14. private $id;
  15. #[ManyToOne(targetEntity: User::class)]
  16. private $student;
  17. #[ManyToOne(targetEntity: Topic::class)]
  18. private $topic;
  19. #[Column(type: 'smallint', options: ['unsigned' => true])]
  20. private $points;
  21. public function __construct(User $student, Topic $topic, int $points)
  22. {
  23. $this->student = $student;
  24. $this->topic = $topic;
  25. $this->points = $points;
  26. }
  27. public function getPoints(): int
  28. {
  29. return $this->points;
  30. }
  31. public function setPoints(int $points): void
  32. {
  33. $this->points = $points;
  34. }
  35. public function getTopic(): Topic
  36. {
  37. return $this->topic;
  38. }
  39. }