src/Entity/Core/Textbook/TextbookSubTopic.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Core\Textbook;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Table('textbook_subtopic')]
  6. #[ORM\Entity(repositoryClass: TextbookSubTopicRepository::class)]
  7. class TextbookSubTopic
  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. /**
  17. * @var int
  18. */
  19. #[ORM\Column(name: 'sortorder', type: 'integer')]
  20. private $order;
  21. /**
  22. * @var string
  23. */
  24. #[ORM\Column(name: 'name', type: 'string', length: 255)]
  25. private $name;
  26. /**
  27. * @var TextbookTopic
  28. */
  29. #[ORM\JoinColumn(name: 'topic_id', referencedColumnName: 'id')]
  30. #[ORM\ManyToOne(targetEntity: TextbookTopic::class, inversedBy: 'textbookSubTopics')]
  31. private $textbookTopic;
  32. /**
  33. * @var TextbookElement[]
  34. */
  35. #[ORM\OneToMany(targetEntity: TextbookElement::class, mappedBy: 'textbookSubTopic', cascade: ['persist'])]
  36. private $textbookElements;
  37. /**
  38. *
  39. * @var ArrayCollection
  40. */
  41. #[ORM\OneToMany(targetEntity: TextbookSubTopicQuestion::class, mappedBy: 'subTopic', cascade: ['persist', 'remove'])]
  42. private $questions;
  43. /**
  44. * @var ArrayCollection|textbookSession[]
  45. *
  46. */
  47. #[ORM\ManyToMany(targetEntity: TextbookSession::class, mappedBy: 'textbookSubtopics')]
  48. private $textbookSessions;
  49. /**
  50. * @var bool
  51. */
  52. #[ORM\Column(type: 'boolean', name: 'is_enabled', options: ['default' => true])]
  53. private $isEnabled;
  54. public function getId(): int
  55. {
  56. return $this->id;
  57. }
  58. /**
  59. * @return int
  60. */
  61. public function getOrder()
  62. {
  63. return $this->order;
  64. }
  65. /**
  66. * @return string
  67. */
  68. public function getName()
  69. {
  70. return $this->name;
  71. }
  72. /**
  73. * @return TextbookTopic
  74. */
  75. public function getTextbookTopic()
  76. {
  77. return $this->textbookTopic;
  78. }
  79. /**
  80. * @return TextbookElement[]
  81. */
  82. public function getTextbookElements()
  83. {
  84. return $this->textbookElements;
  85. }
  86. /**
  87. * @return TextbookSubTopicQuestion[]
  88. */
  89. public function getQuestions()
  90. {
  91. return $this->questions;
  92. }
  93. public function isEnabled(): bool
  94. {
  95. return $this->isEnabled;
  96. }
  97. }