src/CoreBundle/Entity/PeerFeedback.php line 12

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. /**
  5. * @ORM\Table("peer_feedback")
  6. * @ORM\Entity(repositoryClass="CoreBundle\Entity\PeerFeedbackRepository")
  7. */
  8. class PeerFeedback
  9. {
  10. /**
  11. * @var int
  12. *
  13. * @ORM\Column(name="id", type="integer")
  14. * @ORM\Id
  15. * @ORM\GeneratedValue(strategy="AUTO")
  16. */
  17. private $id;
  18. /**
  19. * @var PeerUnit
  20. *
  21. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\PeerUnit", inversedBy="peerFeedbacks")
  22. * @ORM\JoinColumn(name="peer_unit", referencedColumnName="id", onDelete="CASCADE")
  23. */
  24. private $peerUnit;
  25. /**
  26. * @var PeerSolution
  27. *
  28. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\PeerSolution", inversedBy="peerFeedbacks")
  29. * @ORM\JoinColumn(name="peer_solution", referencedColumnName="id", onDelete="CASCADE")
  30. */
  31. private $peerSolution;
  32. /**
  33. * @ORM\OneToOne(targetEntity="PeerFeedback2nd", mappedBy="peerFeedback", cascade={"persist","remove"})
  34. */
  35. private ?PeerFeedback2nd $peerFeedback2nd;
  36. /**
  37. * @ORM\Column(name="feedback_text", type="text", nullable=true)
  38. */
  39. private ?string $feedbackText;
  40. /**
  41. * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  42. *
  43. * @var \DateTime
  44. */
  45. private $updatedAt;
  46. /**
  47. * @ORM\Column(type="integer", nullable=true)
  48. */
  49. private ?int $rating = null;
  50. /**
  51. * @return int
  52. */
  53. public function getId(): int
  54. {
  55. return $this->id;
  56. }
  57. /**
  58. * @return PeerUnit
  59. */
  60. public function getPeerUnit(): PeerUnit
  61. {
  62. return $this->peerUnit;
  63. }
  64. /**
  65. * @param PeerUnit $peerUnit
  66. */
  67. public function setPeerUnit(PeerUnit $peerUnit)
  68. {
  69. $this->peerUnit = $peerUnit;
  70. }
  71. /**
  72. * @return PeerSolution
  73. */
  74. public function getPeerSolution(): PeerSolution
  75. {
  76. return $this->peerSolution;
  77. }
  78. /**
  79. * @param PeerSolution $peerSolution
  80. */
  81. public function setPeerSolution(PeerSolution $peerSolution)
  82. {
  83. $this->peerSolution = $peerSolution;
  84. }
  85. public function getFeedbackText(): ?string
  86. {
  87. return $this->feedbackText;
  88. }
  89. /**
  90. * @param string $feedbackText
  91. * @throws \Exception
  92. */
  93. public function setFeedbackText(string $feedbackText)
  94. {
  95. $this->feedbackText = $feedbackText;
  96. $this->updatedAt = new \DateTimeImmutable('now', new \DateTimeZone('Europe/Copenhagen'));
  97. }
  98. public function getRating(): ?int
  99. {
  100. return $this->rating;
  101. }
  102. /**
  103. * @throws \Exception
  104. */
  105. public function setRating(int $rating)
  106. {
  107. $this->rating = $rating;
  108. $this->updatedAt = new \DateTimeImmutable('now', new \DateTimeZone('Europe/Copenhagen'));
  109. }
  110. public function getPeerFeedback2nd(): ?PeerFeedback2nd
  111. {
  112. return $this->peerFeedback2nd;
  113. }
  114. public function setPeerFeedback2nd(PeerFeedback2nd $peerFeedback2nd)
  115. {
  116. $this->peerFeedback2nd = $peerFeedback2nd;
  117. }
  118. public function getUpdatedAt(): ?\DateTimeInterface
  119. {
  120. return $this->updatedAt;
  121. }
  122. }