src/CoreBundle/Entity/PeerGroup.php line 14

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Table("peer_group")
  8. * @ORM\Entity
  9. */
  10. class PeerGroup
  11. {
  12. /**
  13. * @var int
  14. *
  15. * @ORM\Column(name="id", type="integer")
  16. * @ORM\Id
  17. * @ORM\GeneratedValue(strategy="AUTO")
  18. */
  19. private $id;
  20. /**
  21. * @ORM\Column(type="integer", nullable=true)
  22. */
  23. private $currentStage = 45;
  24. /**
  25. * @var PeerSession
  26. *
  27. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\PeerSession", inversedBy="peerGroups")
  28. * @ORM\JoinColumn(name="peer_session", referencedColumnName="id", onDelete="CASCADE")
  29. */
  30. private $peerSession;
  31. /**
  32. * @ORM\ManyToOne(targetEntity="PeerMathproblem")
  33. * @ORM\JoinColumn(name="peer_problem_id", nullable=true)
  34. */
  35. private ?PeerMathproblem $peerProblem;
  36. /**
  37. * @ORM\OneToMany(targetEntity="PeerUnit", mappedBy="peerGroup", cascade={"persist", "remove"})
  38. */
  39. private Collection $peerUnits;
  40. /**
  41. * PeerGroup constructor.
  42. */
  43. public function __construct()
  44. {
  45. $this->peerUnits = new ArrayCollection();
  46. }
  47. /**
  48. * @return int
  49. */
  50. public function getId(): int
  51. {
  52. return $this->id;
  53. }
  54. /**
  55. * @return mixed
  56. */
  57. public function getCurrentStage()
  58. {
  59. return $this->currentStage;
  60. }
  61. /**
  62. * @param mixed $currentStage
  63. */
  64. public function setCurrentStage($currentStage)
  65. {
  66. $this->currentStage = $currentStage;
  67. }
  68. /**
  69. * @return PeerSession
  70. */
  71. public function getPeerSession(): PeerSession
  72. {
  73. return $this->peerSession;
  74. }
  75. /**
  76. * @param PeerSession $peerSession
  77. */
  78. public function setPeerSession(PeerSession $peerSession)
  79. {
  80. $this->peerSession = $peerSession;
  81. }
  82. /**
  83. * @return ArrayCollection | PeerUnit[]
  84. */
  85. public function getPeerUnits(): Collection
  86. {
  87. return $this->peerUnits;
  88. }
  89. public function addPeerUnit(PeerUnit $peerUnit)
  90. {
  91. $peerUnit->setPeerGroup($this);
  92. $this->peerUnits->add($peerUnit);
  93. }
  94. public function getPeerProblem(): ?PeerMathproblem
  95. {
  96. return $this->peerProblem;
  97. }
  98. public function setPeerProblem(PeerMathproblem $peerProblem): void
  99. {
  100. $this->peerProblem = $peerProblem;
  101. }
  102. }