src/Entity/Core/SelfStudy/SelfStudy.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Core\SelfStudy;
  3. use App\Entity\Core\Classroom\ClassroomType;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Table('self_study')]
  8. #[ORM\Entity]
  9. class SelfStudy
  10. {
  11. /**
  12. * @var int
  13. */
  14. #[ORM\Column(name: 'id', type: 'integer')]
  15. #[ORM\Id]
  16. #[ORM\GeneratedValue(strategy: 'AUTO')]
  17. private $id;
  18. /**
  19. * @var string
  20. */
  21. #[ORM\Column(name: 'display_name', type: 'string', length: 255)]
  22. private $displayName;
  23. /**
  24. * @var ClassroomType
  25. */
  26. #[ORM\JoinColumn(name: 'classroom_type', referencedColumnName: 'id')]
  27. #[ORM\OneToOne(targetEntity: ClassroomType::class)]
  28. private $classroomType;
  29. /**
  30. * @var ArrayCollection|SelfStudyCategory[]
  31. */
  32. #[ORM\OneToMany(targetEntity: SelfStudyCategory::class, mappedBy: 'selfStudy')]
  33. private $selfStudyCategories;
  34. /**
  35. * @var ArrayCollection|SelfStudyTypicalExamProblem[]
  36. */
  37. #[ORM\ManyToMany(targetEntity: SelfStudyTypicalExamProblem::class, mappedBy: 'selfStudyList')]
  38. private $typicalExamProblems;
  39. /**
  40. * @var ArrayCollection|SelfStudyExamQuiz[]
  41. */
  42. #[ORM\OneToMany(targetEntity: SelfStudyExamQuiz::class, mappedBy: 'selfStudy')]
  43. private $selfStudyExamQuizzes;
  44. /**
  45. * @var bool
  46. */
  47. #[ORM\Column(name: 'has_exam_card', type: 'boolean', options: ['default' => true])]
  48. private bool $hasExamCard = true;
  49. /**
  50. * @var string
  51. */
  52. #[ORM\Column(name: 'typical_exam_problem_teaser', type: 'string', length: 1000, nullable: true, options: ['default' => ''])]
  53. private $typicalExamProblemTeaser;
  54. public function __construct()
  55. {
  56. $this->selfStudyCategories = new ArrayCollection();
  57. $this->typicalExamProblems = new ArrayCollection();
  58. }
  59. public function getId(): int
  60. {
  61. return $this->id;
  62. }
  63. public function getDisplayName(): string
  64. {
  65. return $this->displayName;
  66. }
  67. public function getClassroomType(): ClassroomType
  68. {
  69. return $this->classroomType;
  70. }
  71. public function getTypicalExamProblems(): Collection
  72. {
  73. return $this->typicalExamProblems;
  74. }
  75. public function getSelfStudyCategories(): Collection
  76. {
  77. return $this->selfStudyCategories;
  78. }
  79. public function getTypicalExamProblemTeaser(): ?string
  80. {
  81. return $this->typicalExamProblemTeaser;
  82. }
  83. public function hasExamCard(): bool
  84. {
  85. return $this->hasExamCard;
  86. }
  87. public function __toString()
  88. {
  89. return $this->displayName;
  90. }
  91. }