src/Entity/BugReport.php line 18

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\BugReportRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
  8. use Symfony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
  9. use Symfony\Component\Security\Core\User\UserInterface;
  10. use Symfony\Component\Serializer\Annotation\Groups;
  11. use Symfony\Component\Validator\Constraints as Assert;
  12. /**
  13. * @ORM\Entity(repositoryClass=BugReportRepository::class)
  14. */
  15. class BugReport
  16. {
  17. const STATUS_NEW = [
  18. 'value' => 0,
  19. 'text' => 'Naujas',
  20. 'color' => '#f8d7da'
  21. ];
  22. const STATUS_IN_PROGRESS = [
  23. 'value' => 1,
  24. 'text' => 'Vykdomas',
  25. 'color' => '#d4edda'
  26. ];
  27. const STATUS_WAITING_PR = [
  28. 'value' => 4,
  29. 'text' => 'Laukiama PR',
  30. 'color' => '#c8956a'
  31. ];
  32. const STATUS_DONE = [
  33. 'value' => 2,
  34. 'text' => 'Išspręstas',
  35. 'color' => '#0cb535'
  36. ];
  37. const STATUS_CANCELLED = [
  38. 'value' => 3,
  39. 'text' => 'Atšauktas',
  40. 'color' => '#ffa600'
  41. ];
  42. const STATUS_LOW = [
  43. 'value' => 'low',
  44. 'text' => 'Low',
  45. 'color' => '#85d7a2'
  46. ];
  47. const STATUS_MEDIUM = [
  48. 'value' => 'medium',
  49. 'text' => 'Medium',
  50. 'color' => '#fea06a'
  51. ];
  52. const STATUS_HIGH = [
  53. 'value' => 'high',
  54. 'text' => 'High',
  55. 'color' => '#ff878a'
  56. ];
  57. const STATUSES = [
  58. self::STATUS_NEW,
  59. self::STATUS_IN_PROGRESS,
  60. self::STATUS_WAITING_PR,
  61. self::STATUS_DONE,
  62. self::STATUS_CANCELLED,
  63. ];
  64. const PRIORITIES = [
  65. self::STATUS_LOW,
  66. self::STATUS_MEDIUM,
  67. self::STATUS_HIGH,
  68. ];
  69. /**
  70. * @ORM\Id
  71. * @ORM\GeneratedValue
  72. * @ORM\Column(type="integer")
  73. */
  74. private $id;
  75. /**
  76. * @ORM\Column(type="string", length=10)
  77. */
  78. private $priority;
  79. /**
  80. * @ORM\Column(type="text")
  81. */
  82. private $message;
  83. /**
  84. * @ORM\Column(type="string", length=30)
  85. */
  86. private $difficultiesFor;
  87. /**
  88. * @ORM\Column(type="integer")
  89. * */
  90. private $status;
  91. /**
  92. * @ORM\Column(type="string", length=5000)
  93. * */
  94. private $stepsToReproduce;
  95. /**
  96. * @ORM\Column(type="string", length=5000)
  97. * */
  98. private $currentUrl;
  99. /**
  100. * @ORM\Column(type="datetime", length=30)
  101. */
  102. private $createdAt;
  103. /**
  104. * @ORM\Column(type="datetime", length=30)
  105. */
  106. private $updatedAt;
  107. /**
  108. * @ORM\ManyToOne(targetEntity=Admin::class, inversedBy="bugReports")
  109. */
  110. private ?Admin $admin;
  111. /**
  112. * @ORM\ManyToOne(targetEntity=Admin::class)
  113. */
  114. private ?Admin $assignee = null;
  115. /**
  116. * @ORM\Column(type="integer", nullable=true)
  117. * */
  118. private $timeInMinutes;
  119. /**
  120. * @ORM\Column(type="text", nullable=true)
  121. */
  122. private ?string $adminComment = null;
  123. public function __construct()
  124. {
  125. $this->createdAt = new \DateTime();
  126. $this->updatedAt = new \DateTime();
  127. $this->status = 0;
  128. $this->timeInMinutes = 0;
  129. }
  130. /**
  131. * @return mixed
  132. */
  133. public function getId()
  134. {
  135. return $this->id;
  136. }
  137. /**
  138. * @param mixed $id
  139. */
  140. public function setId($id): void
  141. {
  142. $this->id = $id;
  143. }
  144. /**
  145. * @return mixed
  146. */
  147. public function getPriority()
  148. {
  149. return $this->priority;
  150. }
  151. /**
  152. * @param mixed $priority
  153. */
  154. public function setPriority($priority): void
  155. {
  156. $this->priority = $priority;
  157. }
  158. /**
  159. * @return mixed
  160. */
  161. public function getMessage()
  162. {
  163. return $this->message;
  164. }
  165. /**
  166. * @param mixed $message
  167. */
  168. public function setMessage($message): void
  169. {
  170. $this->message = $message;
  171. }
  172. /**
  173. * @return mixed
  174. */
  175. public function getDifficultiesFor()
  176. {
  177. return $this->difficultiesFor;
  178. }
  179. /**
  180. * @param mixed $difficultiesFor
  181. */
  182. public function setDifficultiesFor($difficultiesFor): void
  183. {
  184. $this->difficultiesFor = $difficultiesFor;
  185. }
  186. /**
  187. * @return mixed
  188. */
  189. public function getStepsToReproduce()
  190. {
  191. return $this->stepsToReproduce;
  192. }
  193. /**
  194. * @param mixed $stepsToReproduce
  195. */
  196. public function setStepsToReproduce($stepsToReproduce): void
  197. {
  198. $this->stepsToReproduce = $stepsToReproduce;
  199. }
  200. public function getCreatedAt(): \DateTime
  201. {
  202. return $this->createdAt;
  203. }
  204. public function setCreatedAt(\DateTime $createdAt): void
  205. {
  206. $this->createdAt = $createdAt;
  207. }
  208. public function getUpdatedAt(): \DateTime
  209. {
  210. return $this->updatedAt;
  211. }
  212. public function setUpdatedAt(\DateTime $updatedAt): void
  213. {
  214. $this->updatedAt = $updatedAt;
  215. }
  216. public function getAdmin(): ?Admin
  217. {
  218. return $this->admin;
  219. }
  220. public function setAdmin(?Admin $admin): self
  221. {
  222. $this->admin = $admin;
  223. return $this;
  224. }
  225. public function getAssignee(): ?Admin
  226. {
  227. return $this->assignee;
  228. }
  229. public function setAssignee(?Admin $assignee): self
  230. {
  231. $this->assignee = $assignee;
  232. return $this;
  233. }
  234. public function getStatus(): ?int
  235. {
  236. return $this->status;
  237. }
  238. public function setStatus($status): self
  239. {
  240. $this->status = $status;
  241. return $this;
  242. }
  243. public function getCurrentUrl(): ?string
  244. {
  245. return $this->currentUrl;
  246. }
  247. public function setCurrentUrl(string $currentUrl): self
  248. {
  249. $this->currentUrl = $currentUrl;
  250. return $this;
  251. }
  252. /**
  253. * @return null|int
  254. */
  255. public function getTimeInMinutes(): ?int
  256. {
  257. return $this->timeInMinutes;
  258. }
  259. /**
  260. * @param int $timeInMinutes
  261. */
  262. public function setTimeInMinutes(int $timeInMinutes): void
  263. {
  264. $this->timeInMinutes = $timeInMinutes;
  265. }
  266. public function getAdminComment(): ?string
  267. {
  268. return $this->adminComment;
  269. }
  270. public function setAdminComment(?string $adminComment): self
  271. {
  272. $this->adminComment = $adminComment;
  273. return $this;
  274. }
  275. }