CurriculumCategory.php 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. <?php
  2. namespace Entity;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Gedmo\Mapping\Annotation as Gedmo;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. /**
  7. * CurriculumCategory
  8. *
  9. * @Gedmo\Tree(type="nested")
  10. * @ORM\Table(name="curriculum_category")
  11. * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository")
  12. */
  13. class CurriculumCategory
  14. {
  15. /**
  16. * @var integer
  17. *
  18. * @ORM\Column(name="id", type="integer", precision=0, scale=0, nullable=false, unique=false)
  19. * @ORM\Id
  20. * @ORM\GeneratedValue(strategy="IDENTITY")
  21. */
  22. private $id;
  23. /**
  24. * @var integer
  25. *
  26. * @ORM\Column(name="c_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
  27. */
  28. private $cId;
  29. /**
  30. * @var integer
  31. *
  32. * @ORM\Column(name="session_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
  33. */
  34. private $sessionId;
  35. /**
  36. * @var string
  37. *
  38. * @ORM\Column(name="title", type="string", length=255, precision=0, scale=0, nullable=true, unique=false)
  39. */
  40. private $title;
  41. /**
  42. * @var integer
  43. *
  44. * @ORM\Column(name="max_score", type="integer", precision=0, scale=0, nullable=false, unique=false)
  45. */
  46. private $maxScore;
  47. /**
  48. * @var boolean
  49. *
  50. * @ORM\Column(name="min_chars", type="boolean", precision=0, scale=0, nullable=false, unique=false)
  51. */
  52. private $minChars;
  53. /**
  54. * @Gedmo\TreeParent
  55. * @ORM\ManyToOne(targetEntity="CurriculumCategory", inversedBy="children")
  56. * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", onDelete="SET NULL")
  57. */
  58. private $parent;
  59. /**
  60. * @var integer
  61. *
  62. * @ORM\Column(name="parent_id", type="integer", precision=0, scale=0, nullable=true, unique=false)
  63. */
  64. private $parentId;
  65. /**
  66. * @Gedmo\TreeLevel
  67. * @ORM\Column(name="lvl", type="integer")
  68. */
  69. private $lvl;
  70. /**
  71. * @Gedmo\TreeLeft
  72. * @ORM\Column(name="lft", type="integer")
  73. */
  74. private $lft;
  75. /**
  76. * @Gedmo\TreeRight
  77. * @ORM\Column(name="rgt", type="integer")
  78. */
  79. private $rgt;
  80. /**
  81. * @Gedmo\TreeRoot
  82. * @ORM\Column(name="root", type="integer", nullable=true)
  83. */
  84. private $root;
  85. /**
  86. * @ORM\OneToMany(targetEntity="CurriculumCategory", mappedBy="parent")
  87. * @ORM\OrderBy({"lft" = "ASC"})
  88. */
  89. private $children;
  90. /**
  91. * @ORM\OneToMany(targetEntity="CurriculumItem", mappedBy="category")
  92. * @ORM\OrderBy({"title" = "ASC"})
  93. */
  94. private $items;
  95. /**
  96. * @ORM\ManyToOne(targetEntity="Course")
  97. * @ORM\JoinColumn(name="c_id", referencedColumnName="id")
  98. */
  99. private $course;
  100. /**
  101. * @ORM\ManyToOne(targetEntity="Session")
  102. * @ORM\JoinColumn(name="session_id", referencedColumnName="id")
  103. */
  104. private $session;
  105. public function __construct()
  106. {
  107. $this->items = new ArrayCollection();
  108. }
  109. /**
  110. * @return mixed
  111. */
  112. public function getSession()
  113. {
  114. return $this->session;
  115. }
  116. /**
  117. * @param Session $session
  118. * @return mixed
  119. */
  120. public function setSession(Session $session)
  121. {
  122. $this->session = $session;
  123. }
  124. /**
  125. * @return mixed
  126. */
  127. public function getCourse()
  128. {
  129. return $this->course;
  130. }
  131. /**
  132. * @param Course $course
  133. * @return mixed
  134. */
  135. public function setCourse(Course $course)
  136. {
  137. $this->course = $course;
  138. }
  139. /**
  140. * @return ArrayCollection
  141. */
  142. public function getItems()
  143. {
  144. return $this->items;
  145. }
  146. /**
  147. * @param CurriculumCategory $parent
  148. */
  149. public function setParent(CurriculumCategory $parent = null)
  150. {
  151. $this->parent = $parent;
  152. }
  153. /**
  154. * @return CurriculumCategory
  155. */
  156. public function getParent()
  157. {
  158. return $this->parent;
  159. }
  160. /**
  161. * Get id
  162. *
  163. * @return integer
  164. */
  165. public function getId()
  166. {
  167. return $this->id;
  168. }
  169. /**
  170. * Set cId
  171. *
  172. * @param integer $cId
  173. * @return CurriculumCategory
  174. */
  175. public function setCId($cId)
  176. {
  177. $this->cId = $cId;
  178. return $this;
  179. }
  180. /**
  181. * Get cId
  182. *
  183. * @return integer
  184. */
  185. public function getCId()
  186. {
  187. return $this->cId;
  188. }
  189. /**
  190. * Set sessionId
  191. *
  192. * @param integer $sessionId
  193. * @return CurriculumCategory
  194. */
  195. public function setSessionId($sessionId)
  196. {
  197. $this->sessionId = $sessionId;
  198. return $this;
  199. }
  200. /**
  201. * Get sessionId
  202. *
  203. * @return integer
  204. */
  205. public function getSessionId()
  206. {
  207. return $this->sessionId;
  208. }
  209. /**
  210. * Set title
  211. *
  212. * @param string $title
  213. * @return CurriculumCategory
  214. */
  215. public function setTitle($title)
  216. {
  217. $this->title = $title;
  218. return $this;
  219. }
  220. /**
  221. * Get title
  222. *
  223. * @return string
  224. */
  225. public function getTitle()
  226. {
  227. return $this->title;
  228. }
  229. /**
  230. * Set maxScore
  231. *
  232. * @param integer $maxScore
  233. * @return CurriculumCategory
  234. */
  235. public function setMaxScore($maxScore)
  236. {
  237. $this->maxScore = $maxScore;
  238. return $this;
  239. }
  240. /**
  241. * Get maxScore
  242. *
  243. * @return integer
  244. */
  245. public function getMaxScore()
  246. {
  247. return $this->maxScore;
  248. }
  249. /**
  250. * Set minChars
  251. *
  252. * @param boolean $minChars
  253. * @return CurriculumCategory
  254. */
  255. public function setMinChars($minChars)
  256. {
  257. $this->minChars = $minChars;
  258. return $this;
  259. }
  260. /**
  261. * Get minChars
  262. *
  263. * @return boolean
  264. */
  265. public function getMinChars()
  266. {
  267. return $this->minChars;
  268. }
  269. /**
  270. * Set parentId
  271. *
  272. * @param integer $parentId
  273. * @return CurriculumCategory
  274. */
  275. public function setParentId($parentId)
  276. {
  277. $this->parentId = $parentId;
  278. return $this;
  279. }
  280. /**
  281. * Get parentId
  282. *
  283. * @return integer
  284. */
  285. public function getParentId()
  286. {
  287. return $this->parentId;
  288. }
  289. /**
  290. * Set lvl
  291. *
  292. * @param integer $lvl
  293. * @return CurriculumCategory
  294. */
  295. public function setLvl($lvl)
  296. {
  297. $this->lvl = $lvl;
  298. return $this;
  299. }
  300. /**
  301. * Get lvl
  302. *
  303. * @return integer
  304. */
  305. public function getLvl()
  306. {
  307. return $this->lvl;
  308. }
  309. /**
  310. * Set lft
  311. *
  312. * @param integer $lft
  313. * @return CurriculumCategory
  314. */
  315. public function setLft($lft)
  316. {
  317. $this->lft = $lft;
  318. return $this;
  319. }
  320. /**
  321. * Get lft
  322. *
  323. * @return integer
  324. */
  325. public function getLft()
  326. {
  327. return $this->lft;
  328. }
  329. /**
  330. * Set rgt
  331. *
  332. * @param integer $rgt
  333. * @return CurriculumCategory
  334. */
  335. public function setRgt($rgt)
  336. {
  337. $this->rgt = $rgt;
  338. return $this;
  339. }
  340. /**
  341. * Get rgt
  342. *
  343. * @return integer
  344. */
  345. public function getRgt()
  346. {
  347. return $this->rgt;
  348. }
  349. /**
  350. * Set root
  351. *
  352. * @param integer $root
  353. * @return CurriculumCategory
  354. */
  355. public function setRoot($root)
  356. {
  357. $this->root = $root;
  358. return $this;
  359. }
  360. /**
  361. * Get root
  362. *
  363. * @return integer
  364. */
  365. public function getRoot()
  366. {
  367. return $this->root;
  368. }
  369. }