src/Entity/Core/Training/TrainingStudent.php line 10

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Core\Training;
  3. use App\Entity\User\User;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Table('training_student')]
  6. #[ORM\Entity]
  7. class TrainingStudent
  8. {
  9. /**
  10. * @var int
  11. */
  12. #[ORM\Column(name: 'id', type: 'integer')]
  13. #[ORM\Id]
  14. #[ORM\GeneratedValue(strategy: 'AUTO')]
  15. private $id;
  16. #[ORM\Column(name: 'is_team_leader', type: 'boolean')]
  17. private bool $isTeamLeader;
  18. /**
  19. * @var TrainingUnit
  20. */
  21. #[ORM\JoinColumn(name: 'TrainingUnit', referencedColumnName: 'id', onDelete: 'CASCADE')]
  22. #[ORM\ManyToOne(targetEntity: TrainingUnit::class, inversedBy: 'TrainingStudents')]
  23. private $trainingUnit;
  24. #[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id')]
  25. #[ORM\ManyToOne(targetEntity: User::class)]
  26. private User $student;
  27. #[ORM\Column(name: 'confirmedCooperation', type: 'boolean')]
  28. private bool $confirmedCooperation = false;
  29. public function setConfirmedCooperation(bool $confirmedCooperation): self
  30. {
  31. $this->confirmedCooperation = $confirmedCooperation;
  32. return $this;
  33. }
  34. public function getConfirmedCooperation(): bool
  35. {
  36. return $this->confirmedCooperation;
  37. }
  38. /**
  39. * Get id.
  40. *
  41. * @return int
  42. */
  43. public function getId()
  44. {
  45. return $this->id;
  46. }
  47. /**
  48. * Set TrainingUnit.
  49. *
  50. * @param TrainingUnit $trainingUnit
  51. *
  52. * @return TrainingStudent
  53. */
  54. public function setTrainingUnit($trainingUnit)
  55. {
  56. $this->trainingUnit = $trainingUnit;
  57. return $this;
  58. }
  59. /**
  60. * Get TrainingUnit.
  61. *
  62. * @return TrainingUnit
  63. */
  64. public function getTrainingUnit()
  65. {
  66. return $this->trainingUnit;
  67. }
  68. public function setStudent(User $student): self
  69. {
  70. $this->student = $student;
  71. return $this;
  72. }
  73. public function getStudent(): User
  74. {
  75. return $this->student;
  76. }
  77. public function setIsTeamLeader(bool $isTeamLeader)
  78. {
  79. $this->isTeamLeader = $isTeamLeader;
  80. }
  81. public function getIsTeamLeader(): bool
  82. {
  83. return $this->isTeamLeader;
  84. }
  85. }