src/Entity/Core/Textbook/TextbookSubTopicQuestion.php line 10

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_question')]
  6. #[ORM\Entity(repositoryClass: TextbookSubTopicQuestionRepository::class)]
  7. class TextbookSubTopicQuestion
  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 string
  18. */
  19. #[ORM\Column(name: 'question_txt', type: 'string', length: 500)]
  20. private $questionTxt;
  21. /**
  22. * @var TextbookSubTopic
  23. */
  24. #[ORM\JoinColumn(name: 'textbook_subtopic_id', referencedColumnName: 'id')]
  25. #[ORM\ManyToOne(targetEntity: TextbookSubTopic::class, inversedBy: 'questions')]
  26. private $subTopic;
  27. /**
  28. *
  29. * @var ArrayCollection
  30. */
  31. #[ORM\OneToMany(targetEntity: TextbookSubTopicAnswer::class, mappedBy: 'question', cascade: ['persist', 'remove'])]
  32. private $answers;
  33. /**
  34. * @return string
  35. */
  36. public function getQuestionTxt()
  37. {
  38. return $this->questionTxt;
  39. }
  40. /**
  41. * @return ArrayCollection
  42. */
  43. public function getAnswers()
  44. {
  45. return $this->answers;
  46. }
  47. /**
  48. * @return int
  49. */
  50. public function getId()
  51. {
  52. return $this->id;
  53. }
  54. /**
  55. * @return TextbookSubTopic
  56. */
  57. public function getSubTopic()
  58. {
  59. return $this->subTopic;
  60. }
  61. }