WorkByUser.php 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. <?php
  2. namespace AppBundle\Entity\Booking;
  3. use AppBundle\Entity\AccessAndFunction\Access;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Dunglas\ApiBundle\Annotation\Iri;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use AppBundle\Entity\Traits\TimestampableEntity;
  8. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  9. /**
  10. *
  11. * Travail à faire pour un cours par un utilisateur
  12. *
  13. * @Iri("http://schema.org/WorkByUser")
  14. */
  15. #[ORM\Entity]
  16. class WorkByUser
  17. {
  18. use TimestampableEntity;
  19. use CreatorUpdaterEntity;
  20. /**
  21. * @var int
  22. */
  23. #[ORM\Column(type: 'integer')]
  24. #[ORM\Id]
  25. #[ORM\GeneratedValue(strategy: 'AUTO')]
  26. #[Groups(['workbyuser', 'worksbyusers_db'])]
  27. private $id;
  28. /**
  29. * @var Work
  30. */
  31. #[ORM\ManyToOne(targetEntity: 'Work', inversedBy: 'workByUsers')]
  32. #[Groups(['workbyuser', 'worksbyusers_db'])]
  33. private $work;
  34. /**
  35. * @var Work
  36. */
  37. #[ORM\ManyToOne(targetEntity: 'AppBundle\Entity\AccessAndFunction\Access', inversedBy: 'workByUsers')]
  38. #[Groups(['workbyuser'])]
  39. private $student;
  40. /**
  41. * @var boolean
  42. */
  43. #[ORM\Column(type: 'boolean', options: ['default' => false])]
  44. #[Groups(['workbyuser', 'worksbyusers_db'])]
  45. private $isDone=false;
  46. /**
  47. * Sets id.
  48. *
  49. * @param int $id
  50. *
  51. * @return $this
  52. */
  53. public function setId($id)
  54. {
  55. $this->id = $id;
  56. return $this;
  57. }
  58. /**
  59. * Gets id.
  60. *
  61. * @return int
  62. */
  63. public function getId()
  64. {
  65. return $this->id;
  66. }
  67. /**
  68. * Sets work.
  69. *
  70. * @param Work $work
  71. *
  72. * @return $this
  73. */
  74. public function setWork(Work $work = null)
  75. {
  76. $this->work = $work;
  77. return $this;
  78. }
  79. /**
  80. * Gets work.
  81. *
  82. * @return Work
  83. */
  84. public function getWork()
  85. {
  86. return $this->work;
  87. }
  88. /**
  89. * Sets student.
  90. *
  91. * @param Access $student
  92. *
  93. * @return $this
  94. */
  95. public function setStudent(Access $student = null)
  96. {
  97. $this->student = $student;
  98. return $this;
  99. }
  100. /**
  101. * Gets student.
  102. *
  103. * @return Access
  104. */
  105. public function getStudent()
  106. {
  107. return $this->student;
  108. }
  109. /**
  110. * Sets isDone.
  111. *
  112. * @param boolean $isDone
  113. *
  114. * @return $this
  115. */
  116. public function setIsDone($isDone)
  117. {
  118. $this->isDone = $isDone;
  119. return $this;
  120. }
  121. /**
  122. * Gets isDone.
  123. *
  124. * @return boolean
  125. */
  126. public function getIsDone()
  127. {
  128. return $this->isDone;
  129. }
  130. }