src/CoreBundle/Entity/TextbookCategory.php line 13

Open in your IDE?
  1. <?php
  2. namespace CoreBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6. * @ORM\Table("textbook_category")
  7. * @ORM\Entity(repositoryClass="TextbookCategoryRepository")
  8. */
  9. class TextbookCategory
  10. {
  11. /**
  12. * @var int
  13. *
  14. * @ORM\Column(name="id", type="integer")
  15. * @ORM\Id
  16. * @ORM\GeneratedValue(strategy="AUTO")
  17. */
  18. private $id;
  19. /**
  20. * @var int
  21. *
  22. * @ORM\Column(name="sortorder", type="integer")
  23. */
  24. private $order;
  25. /**
  26. * @var bool
  27. *
  28. * @ORM\Column(name="is_enabled", type="boolean", options={"default" : true})
  29. */
  30. private $enabled;
  31. /**
  32. * @var string
  33. * @ORM\Column(name="name", type="string", length=255)
  34. */
  35. private $name;
  36. // TODO this will be deleted after migration to $textbook is done
  37. /**
  38. * @var string
  39. * @ORM\Column(name="curriculum", type="string", length=16)
  40. */
  41. private $curriculum;
  42. /**
  43. * @var $textbook
  44. *
  45. * @ORM\ManyToOne(targetEntity="CoreBundle\Entity\Textbook")
  46. * @ORM\JoinColumn(name="textbook", referencedColumnName="id")
  47. */
  48. private $textbook;
  49. /**
  50. * @var TextbookTopic[]
  51. *
  52. * @ORM\OneToMany(targetEntity="TextbookTopic", mappedBy="textbookCategory", cascade={"persist"})
  53. */
  54. private $textbookTopics;
  55. /**
  56. * @return int
  57. */
  58. public function getId(): int
  59. {
  60. return $this->id;
  61. }
  62. /**
  63. * @return string
  64. */
  65. public function getName()
  66. {
  67. return $this->name;
  68. }
  69. /**
  70. * @return int
  71. */
  72. public function getOrder()
  73. {
  74. return $this->order;
  75. }
  76. /**
  77. * @return TextbookTopic[]
  78. */
  79. public function getTextbookTopics()
  80. {
  81. return $this->textbookTopics;
  82. }
  83. /**
  84. * @return bool
  85. */
  86. public function isEnabled(): bool
  87. {
  88. return $this->enabled;
  89. }
  90. /**
  91. * @param bool $enabled
  92. */
  93. public function setEnabled(bool $enabled): void
  94. {
  95. $this->enabled = $enabled;
  96. }
  97. public function getCurriculum(): string
  98. {
  99. return $this->curriculum;
  100. }
  101. public function getTextbook(): Textbook
  102. {
  103. return $this->textbook;
  104. }
  105. }