src/Entity/Core/SelfStudy/SelfStudyTypicalExamProblem.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Core\SelfStudy;
  3. use App\Entity\Core\Quiz\Quiz;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. #[ORM\Table('self_study_typical_exam_problem')]
  8. #[ORM\Entity(repositoryClass: SelfStudyTypicalExamProblemRepository::class)]
  9. class SelfStudyTypicalExamProblem
  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: 'name', type: 'string')]
  22. private $name;
  23. /**
  24. * @var ArrayCollection|SelfStudy[]
  25. */
  26. #[ORM\JoinTable(name: 'relation_self_study_typical_exam_problem')]
  27. #[ORM\JoinColumn(name: 'typical_exam_problem_id', referencedColumnName: 'id')]
  28. #[ORM\InverseJoinColumn(name: 'self_study_id', referencedColumnName: 'id')]
  29. #[ORM\ManyToMany(targetEntity: SelfStudy::class, inversedBy: 'typicalExamProblems')]
  30. private $selfStudyList;
  31. /**
  32. * @var SelfStudyTypicalExamProblemElement[]
  33. */
  34. #[ORM\OneToMany(targetEntity: SelfStudyTypicalExamProblemElement::class, mappedBy: 'problem', cascade: ['persist'])]
  35. private $elements;
  36. /**
  37. * @var Quiz
  38. */
  39. #[ORM\JoinColumn(name: 'quiz', referencedColumnName: 'id')]
  40. #[ORM\ManyToOne(targetEntity: Quiz::class)]
  41. private $quiz;
  42. /**
  43. * @var bool
  44. */
  45. #[ORM\Column(name: 'has_color', type: 'boolean', options: ['default' => false])]
  46. private $hasColor;
  47. public function __construct()
  48. {
  49. $this->selfStudyList = new ArrayCollection();
  50. $this->elements = new ArrayCollection();
  51. }
  52. /**
  53. * @return int
  54. */
  55. public function getId()
  56. {
  57. return $this->id;
  58. }
  59. /**
  60. * @return SelfStudyTypicalExamProblemElement[]
  61. */
  62. public function getElements(): Collection
  63. {
  64. return $this->elements;
  65. }
  66. public function getSelfStudyList(): Collection
  67. {
  68. return $this->selfStudyList;
  69. }
  70. public function getName(): string
  71. {
  72. return $this->name;
  73. }
  74. public function getQuiz(): Quiz
  75. {
  76. return $this->quiz;
  77. }
  78. public function hasColor(): bool
  79. {
  80. return $this->hasColor;
  81. }
  82. }