src/CoreBundle/Entity/TopicPerformance.php line 15

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