src/Entity/Core/BugReport.php line 12

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity\Core;
  4. use DateTime;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use App\Entity\User\User;
  7. #[ORM\Table('bug_report')]
  8. #[ORM\Entity(repositoryClass: BugReportRepository::class)]
  9. class BugReport
  10. {
  11. #[ORM\Column(name: 'id', type: 'integer')]
  12. #[ORM\Id]
  13. #[ORM\GeneratedValue(strategy: 'AUTO')]
  14. private int $id;
  15. #[ORM\Column(name: 'session_id', type: 'integer', nullable: true)]
  16. private ?int $sessionId;
  17. #[ORM\JoinColumn(name: 'mp_id', referencedColumnName: 'id')]
  18. #[ORM\ManyToOne(targetEntity: Mathproblem::class, inversedBy: 'bugReports')]
  19. private Mathproblem $problem;
  20. #[ORM\Column(name: 'mp_error', type: 'boolean', options: ['default' => 0])]
  21. private bool $mpError;
  22. #[ORM\Column(name: 'mp_curriculum', type: 'boolean', options: ['default' => 0])]
  23. private bool $mpCurriculum;
  24. #[ORM\Column(name: 'mp_understanding', type: 'boolean', options: ['default' => 0])]
  25. private bool $mpUnderstanding;
  26. #[ORM\Column(name: 'mp_technical', type: 'boolean', options: ['default' => 0])]
  27. private bool $mpTechnical;
  28. /**
  29. * @var string
  30. */
  31. #[ORM\Column(name: 'message', type: 'string', nullable: true, length: 2000)]
  32. private $message;
  33. /**
  34. * @var string
  35. */
  36. #[ORM\Column(name: 'mp_name', type: 'string', nullable: true)]
  37. private string $mpName;
  38. #[ORM\Column(name: 'browser', type: 'string', nullable: true)]
  39. private string $browser;
  40. #[ORM\Column(name: 'timestamp', type: 'datetime', nullable: true)]
  41. private DateTime $timestamp;
  42. #[ORM\Column(name: 'is_teacher', type: 'boolean', nullable: true)]
  43. private ?bool $isTeacher;
  44. #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id')]
  45. #[ORM\ManyToOne(targetEntity: User::class)]
  46. private User $user;
  47. #[ORM\Column(type: 'datetime', nullable: true)]
  48. private DateTime $dateResolved;
  49. public function getId(): int
  50. {
  51. return $this->id;
  52. }
  53. public function getSessionId(): ?int
  54. {
  55. return $this->sessionId;
  56. }
  57. public function setSessionId(int $sessionId): void
  58. {
  59. $this->sessionId = $sessionId;
  60. }
  61. public function getProblem(): Mathproblem
  62. {
  63. return $this->problem;
  64. }
  65. public function setProblem(Mathproblem $problem): void
  66. {
  67. $this->problem = $problem;
  68. }
  69. public function isMpError(): bool
  70. {
  71. return $this->mpError;
  72. }
  73. public function setMpError(bool $mpError): void
  74. {
  75. $this->mpError = $mpError;
  76. }
  77. public function isMpCurriculum(): bool
  78. {
  79. return $this->mpCurriculum;
  80. }
  81. public function setMpCurriculum(bool $mpCurriculum): void
  82. {
  83. $this->mpCurriculum = $mpCurriculum;
  84. }
  85. public function isMpUnderstanding(): bool
  86. {
  87. return $this->mpUnderstanding;
  88. }
  89. public function setMpUnderstanding(bool $mpUnderstanding): void
  90. {
  91. $this->mpUnderstanding = $mpUnderstanding;
  92. }
  93. public function isMpTechnical(): bool
  94. {
  95. return $this->mpTechnical;
  96. }
  97. public function setMpTechnical(bool $mpTechnical): void
  98. {
  99. $this->mpTechnical = $mpTechnical;
  100. }
  101. public function getMessage(): string
  102. {
  103. return $this->message;
  104. }
  105. public function setMessage(string $message): void
  106. {
  107. $this->message = $message;
  108. }
  109. public function getMpName(): string
  110. {
  111. return $this->mpName;
  112. }
  113. public function setMpName($mpName): void
  114. {
  115. $this->mpName = $mpName;
  116. }
  117. public function isTeacher(): ?bool
  118. {
  119. return $this->isTeacher;
  120. }
  121. public function setIsTeacher($isTeacher): void
  122. {
  123. $this->isTeacher = $isTeacher;
  124. }
  125. public function getUser(): User
  126. {
  127. return $this->user;
  128. }
  129. public function setUser(User $user): void
  130. {
  131. $this->user = $user;
  132. }
  133. public function getBrowser(): string
  134. {
  135. return $this->browser;
  136. }
  137. public function setBrowser(string $browser): void
  138. {
  139. $this->browser = $browser;
  140. }
  141. public function getTimestamp(): DateTime
  142. {
  143. return $this->timestamp;
  144. }
  145. public function setTimestamp(DateTime $timestamp): void
  146. {
  147. $this->timestamp = $timestamp;
  148. }
  149. public function getDateResolved(): ?DateTime
  150. {
  151. return $this->dateResolved;
  152. }
  153. public function setDateResolved(DateTime $dateResolved): void
  154. {
  155. $this->dateResolved = $dateResolved;
  156. }
  157. public function getSnippet(): string
  158. {
  159. return $this->problem->getSnippet();
  160. }
  161. public function getTopic(): ?string
  162. {
  163. return $this->problem->getTemplate()->getTopic()->getName();
  164. }
  165. }