src/CoreBundle/Entity/SharedQuizExtraTeacher.php line 16

Open in your IDE?
  1. <?php declare(strict_types=1);
  2. namespace CoreBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Doctrine\ORM\Mapping\UniqueConstraint;
  5. use UserBundle\Entity\User;
  6. /**
  7. * @ORM\Table("shared_quiz_extra_teacher",uniqueConstraints={@UniqueConstraint(name="unique_session_teacher", columns={"quiz_session", "teacher"})})
  8. * @ORM\Entity
  9. * @ORM\Entity(repositoryClass="CoreBundle\Entity\SharedQuizExtraTeacherRepository")
  10. */
  11. class SharedQuizExtraTeacher
  12. {
  13. /**
  14. * @var int
  15. *
  16. * @ORM\Column(name="id", type="integer")
  17. * @ORM\Id
  18. * @ORM\GeneratedValue(strategy="AUTO")
  19. */
  20. private int $id;
  21. /**
  22. * @var User
  23. *
  24. * @ORM\ManyToOne(targetEntity="UserBundle\Entity\User")
  25. * @ORM\JoinColumn(name="teacher", referencedColumnName="id")
  26. */
  27. private User $teacher;
  28. /**
  29. * @var QuizSession
  30. *
  31. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\QuizSession")
  32. * @ORM\JoinColumn(name="quiz_session", referencedColumnName="id")
  33. */
  34. private QuizSession $quizSession;
  35. /**
  36. * This is the same as QuizSession->isPinned, but for this particular extra teacher, since it would be strange for
  37. * different teachers to share the same pinned/unpinned state.
  38. *
  39. * @ORM\Column(name="is_pinned", type="boolean", options={"default" : false})
  40. */
  41. private bool $isPinned = false;
  42. public function getId(): int
  43. {
  44. return $this->id;
  45. }
  46. public function setId(int $id): void
  47. {
  48. $this->id = $id;
  49. }
  50. /**
  51. * @return User
  52. */
  53. public function getTeacher(): User
  54. {
  55. return $this->teacher;
  56. }
  57. /**
  58. * @param User $teacher
  59. * @return void
  60. */
  61. public function setTeacher(User $teacher): void
  62. {
  63. $this->teacher = $teacher;
  64. }
  65. /**
  66. * @return QuizSession
  67. */
  68. public function getQuizSession(): QuizSession
  69. {
  70. return $this->quizSession;
  71. }
  72. /**
  73. * @param QuizSession $quizSession
  74. * @return void
  75. */
  76. public function setQuizSession(QuizSession $quizSession): void
  77. {
  78. $this->quizSession = $quizSession;
  79. }
  80. public function isPinned(): bool
  81. {
  82. return $this->isPinned;
  83. }
  84. public function setIsPinned(bool $isPinned): void
  85. {
  86. $this->isPinned = $isPinned;
  87. }
  88. }