src/Entity/SubjectLevel.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7. * @ORM\Entity(repositoryClass="App\Repository\SubjectLevelRepository")
  8. */
  9. class SubjectLevel
  10. {
  11. /**
  12. * @ORM\Id()
  13. * @ORM\GeneratedValue()
  14. * @ORM\Column(type="integer")
  15. */
  16. private $id;
  17. /**
  18. * @ORM\Column(type="string", length=150)
  19. */
  20. private $name;
  21. /**
  22. * @ORM\Column(type="string", length=20, nullable=true)
  23. */
  24. private $level;
  25. /**
  26. * @ORM\ManyToOne(targetEntity="App\Entity\Subject", inversedBy="subjectLevels")
  27. */
  28. private $subject;
  29. /**
  30. * @ORM\Column(type="smallint")
  31. */
  32. private $order;
  33. /**
  34. * @ORM\Column(type="string", length=150)
  35. */
  36. private $nameEn;
  37. /**
  38. * @ORM\OneToMany(targetEntity="App\Entity\ProgramUrl", mappedBy="subjectLevel")
  39. */
  40. private $programUrls;
  41. /**
  42. * @ORM\OneToMany(targetEntity="App\Entity\SubscriptionOrder", mappedBy="subjectLevel")
  43. */
  44. private $subscriptionOrder;
  45. /**
  46. * @ORM\OneToMany(targetEntity="App\Entity\Session", mappedBy="level")
  47. */
  48. private $groupSessions;
  49. /**
  50. * @ORM\OneToMany(targetEntity=LevelTest::class, mappedBy="subjectLevel")
  51. */
  52. private $levelTests;
  53. /**
  54. * @ORM\OneToMany(targetEntity=UserPlacementTest::class, mappedBy="testResult")
  55. */
  56. private $userPlacementTests;
  57. /**
  58. * @ORM\OneToMany(targetEntity=TrainingReport::class, mappedBy="level")
  59. */
  60. private $trainingReports;
  61. /**
  62. * @ORM\OneToMany(targetEntity=TeacherLeveltest::class, mappedBy="maxLevel")
  63. */
  64. private $teacherLeveltests;
  65. /**
  66. * @ORM\OneToMany(targetEntity=LevelTestAdvice::class, mappedBy="level")
  67. */
  68. private $levelTestAdvice;
  69. /**
  70. * @ORM\OneToMany(targetEntity=TeacherSubject::class, mappedBy="fromLevel")
  71. */
  72. private $teacherSubjects;
  73. /**
  74. * @ORM\Column(type="boolean")
  75. */
  76. private $isSession = false;
  77. /**
  78. * @ORM\Column(type="integer", nullable=true)
  79. */
  80. private $sessionPrice;
  81. /**
  82. * @ORM\Column(type="boolean", nullable=true)
  83. */
  84. private $sessionIsPublic;
  85. /**
  86. * @ORM\Column(type="smallint", length=3)
  87. */
  88. private $sessionNbCourse;
  89. /**
  90. * @ORM\Column(type="smallint", length=1)
  91. */
  92. private $sessionNbCourseMinByWeek;
  93. /**
  94. * @ORM\Column(type="smallint", length=3)
  95. */
  96. private $sessionDuration;
  97. /**
  98. * @ORM\Column(type="smallint", length=3)
  99. */
  100. private $sessionSeats;
  101. public function __construct()
  102. {
  103. $this->programUrls = new ArrayCollection();
  104. $this->subscriptionOrder = new ArrayCollection();
  105. $this->groupSessions = new ArrayCollection();
  106. $this->levelTests = new ArrayCollection();
  107. $this->userPlacementTests = new ArrayCollection();
  108. $this->trainingReports = new ArrayCollection();
  109. $this->teacherLeveltests = new ArrayCollection();
  110. $this->levelTestAdvice = new ArrayCollection();
  111. $this->teacherSubjects = new ArrayCollection();
  112. }
  113. public function getId(): ?int
  114. {
  115. return $this->id;
  116. }
  117. public function getName(): ?string
  118. {
  119. return $this->name;
  120. }
  121. public function setName(string $name): self
  122. {
  123. $this->name = $name;
  124. return $this;
  125. }
  126. public function getLevel(): ?string
  127. {
  128. return $this->level;
  129. }
  130. public function setLevel(?string $level): self
  131. {
  132. $this->level = $level;
  133. return $this;
  134. }
  135. public function getSubject(): ?Subject
  136. {
  137. return $this->subject;
  138. }
  139. public function setSubject(?Subject $subject): self
  140. {
  141. $this->subject = $subject;
  142. return $this;
  143. }
  144. public function getNameEn(): ?string
  145. {
  146. return $this->nameEn;
  147. }
  148. public function setNameEn(string $nameEn): self
  149. {
  150. $this->nameEn = $nameEn;
  151. return $this;
  152. }
  153. /**
  154. * @return Collection|ProgramUrl[]
  155. */
  156. public function getProgramUrls(): Collection
  157. {
  158. return $this->programUrls;
  159. }
  160. public function addProgramUrl(ProgramUrl $programUrl): self
  161. {
  162. if ( ! $this->programUrls->contains($programUrl)) {
  163. $this->programUrls[] = $programUrl;
  164. $programUrl->setSubjectLevel($this);
  165. }
  166. return $this;
  167. }
  168. public function removeProgramUrl(ProgramUrl $programUrl): self
  169. {
  170. if ($this->programUrls->contains($programUrl)) {
  171. $this->programUrls->removeElement($programUrl);
  172. // set the owning side to null (unless already changed)
  173. if ($programUrl->getSubjectLevel() === $this) {
  174. $programUrl->setSubjectLevel(null);
  175. }
  176. }
  177. return $this;
  178. }
  179. /**
  180. * @return Collection|SubscriptionOrder[]
  181. */
  182. public function getSubscriptionOrder(): Collection
  183. {
  184. return $this->subscriptionOrder;
  185. }
  186. public function addSubscriptionOrder(SubscriptionOrder $subscriptionOrder): self
  187. {
  188. if ( ! $this->subscriptionOrder->contains($subscriptionOrder)) {
  189. $this->subscriptionOrder[] = $subscriptionOrder;
  190. $subscriptionOrder->setSubjectLevel($this);
  191. }
  192. return $this;
  193. }
  194. public function removeSubscriptionOrder(SubscriptionOrder $subscriptionOrder): self
  195. {
  196. if ($this->subscriptionOrder->contains($subscriptionOrder)) {
  197. $this->subscriptionOrder->removeElement($subscriptionOrder);
  198. // set the owning side to null (unless already changed)
  199. if ($subscriptionOrder->getSubjectLevel() === $this) {
  200. $subscriptionOrder->setSubjectLevel(null);
  201. }
  202. }
  203. return $this;
  204. }
  205. /**
  206. * @return Collection|Session[]
  207. */
  208. public function getGroupSessions(): Collection
  209. {
  210. return $this->groupSessions;
  211. }
  212. public function addGroupSession(Session $groupSession): self
  213. {
  214. if ( ! $this->groupSessions->contains($groupSession)) {
  215. $this->groupSessions[] = $groupSession;
  216. $groupSession->setLevel($this);
  217. }
  218. return $this;
  219. }
  220. public function removeGroupSession(Session $groupSession): self
  221. {
  222. if ($this->groupSessions->contains($groupSession)) {
  223. $this->groupSessions->removeElement($groupSession);
  224. // set the owning side to null (unless already changed)
  225. if ($groupSession->getLevel() === $this) {
  226. $groupSession->setLevel(null);
  227. }
  228. }
  229. return $this;
  230. }
  231. public function __toString()
  232. {
  233. return $this->getNameEn();
  234. }
  235. /**
  236. * @return Collection|LevelTest[]
  237. */
  238. public function getLevelTests(): Collection
  239. {
  240. return $this->levelTests;
  241. }
  242. public function addLevelTest(LevelTest $levelTest): self
  243. {
  244. if ( ! $this->levelTests->contains($levelTest)) {
  245. $this->levelTests[] = $levelTest;
  246. $levelTest->setSubjectLevel($this);
  247. }
  248. return $this;
  249. }
  250. public function removeLevelTest(LevelTest $levelTest): self
  251. {
  252. if ($this->levelTests->removeElement($levelTest)) {
  253. // set the owning side to null (unless already changed)
  254. if ($levelTest->getSubjectLevel() === $this) {
  255. $levelTest->setSubjectLevel(null);
  256. }
  257. }
  258. return $this;
  259. }
  260. /**
  261. * @return Collection|UserPlacementTest[]
  262. */
  263. public function getUserPlacementTests(): Collection
  264. {
  265. return $this->userPlacementTests;
  266. }
  267. public function addUserPlacementTest(UserPlacementTest $userPlacementTest): self
  268. {
  269. if ( ! $this->userPlacementTests->contains($userPlacementTest)) {
  270. $this->userPlacementTests[] = $userPlacementTest;
  271. $userPlacementTest->setTestResult($this);
  272. }
  273. return $this;
  274. }
  275. public function removeUserPlacementTest(UserPlacementTest $userPlacementTest): self
  276. {
  277. if ($this->userPlacementTests->removeElement($userPlacementTest)) {
  278. // set the owning side to null (unless already changed)
  279. if ($userPlacementTest->getTestResult() === $this) {
  280. $userPlacementTest->setTestResult(null);
  281. }
  282. }
  283. return $this;
  284. }
  285. /**
  286. * @return Collection|TrainingReport[]
  287. */
  288. public function getTrainingReports(): Collection
  289. {
  290. return $this->trainingReports;
  291. }
  292. public function addTrainingReport(TrainingReport $trainingReport): self
  293. {
  294. if ( ! $this->trainingReports->contains($trainingReport)) {
  295. $this->trainingReports[] = $trainingReport;
  296. $trainingReport->setLevel($this);
  297. }
  298. return $this;
  299. }
  300. public function removeTrainingReport(TrainingReport $trainingReport): self
  301. {
  302. if ($this->trainingReports->removeElement($trainingReport)) {
  303. // set the owning side to null (unless already changed)
  304. if ($trainingReport->getLevel() === $this) {
  305. $trainingReport->setLevel(null);
  306. }
  307. }
  308. return $this;
  309. }
  310. /**
  311. * @return Collection<int, TeacherLeveltest>
  312. */
  313. public function getTeacherLeveltests(): Collection
  314. {
  315. return $this->teacherLeveltests;
  316. }
  317. public function addTeacherLeveltest(TeacherLeveltest $teacherLeveltest): self
  318. {
  319. if ( ! $this->teacherLeveltests->contains($teacherLeveltest)) {
  320. $this->teacherLeveltests[] = $teacherLeveltest;
  321. $teacherLeveltest->setMaxLevel($this);
  322. }
  323. return $this;
  324. }
  325. public function removeTeacherLeveltest(TeacherLeveltest $teacherLeveltest): self
  326. {
  327. if ($this->teacherLeveltests->removeElement($teacherLeveltest)) {
  328. // set the owning side to null (unless already changed)
  329. if ($teacherLeveltest->getMaxLevel() === $this) {
  330. $teacherLeveltest->setMaxLevel(null);
  331. }
  332. }
  333. return $this;
  334. }
  335. /**
  336. * @return Collection<int, LevelTestAdvice>
  337. */
  338. public function getLevelTestAdvice(): Collection
  339. {
  340. return $this->levelTestAdvice;
  341. }
  342. public function addLevelTestAdvice(LevelTestAdvice $levelTestAdvice): self
  343. {
  344. if ( ! $this->levelTestAdvice->contains($levelTestAdvice)) {
  345. $this->levelTestAdvice[] = $levelTestAdvice;
  346. $levelTestAdvice->setLevel($this);
  347. }
  348. return $this;
  349. }
  350. public function removeLevelTestAdvice(LevelTestAdvice $levelTestAdvice): self
  351. {
  352. if ($this->levelTestAdvice->removeElement($levelTestAdvice)) {
  353. // set the owning side to null (unless already changed)
  354. if ($levelTestAdvice->getLevel() === $this) {
  355. $levelTestAdvice->setLevel(null);
  356. }
  357. }
  358. return $this;
  359. }
  360. /**
  361. * @return Collection<int, TeacherSubject>
  362. */
  363. public function getTeacherSubjects(): Collection
  364. {
  365. return $this->teacherSubjects;
  366. }
  367. public function addTeacherSubject(TeacherSubject $teacherSubject): self
  368. {
  369. if ( ! $this->teacherSubjects->contains($teacherSubject)) {
  370. $this->teacherSubjects[] = $teacherSubject;
  371. $teacherSubject->setFromLevel($this);
  372. }
  373. return $this;
  374. }
  375. public function removeTeacherSubject(TeacherSubject $teacherSubject): self
  376. {
  377. if ($this->teacherSubjects->removeElement($teacherSubject)) {
  378. // set the owning side to null (unless already changed)
  379. if ($teacherSubject->getFromLevel() === $this) {
  380. $teacherSubject->setFromLevel(null);
  381. }
  382. }
  383. return $this;
  384. }
  385. public function isSession(): bool
  386. {
  387. return $this->isSession;
  388. }
  389. public function setIsSession(bool $isSession): void
  390. {
  391. $this->isSession = $isSession;
  392. }
  393. /**
  394. * @return mixed
  395. */
  396. public function getSessionPrice()
  397. {
  398. return $this->sessionPrice;
  399. }
  400. /**
  401. * @param mixed $sessionPrice
  402. */
  403. public function setSessionPrice($sessionPrice): void
  404. {
  405. $this->sessionPrice = $sessionPrice;
  406. }
  407. /**
  408. * @return mixed
  409. */
  410. public function getSessionIsPublic()
  411. {
  412. return $this->sessionIsPublic;
  413. }
  414. /**
  415. * @param mixed $sessionIsPublic
  416. */
  417. public function setSessionIsPublic($sessionIsPublic): void
  418. {
  419. $this->sessionIsPublic = $sessionIsPublic;
  420. }
  421. /**
  422. * @return mixed
  423. */
  424. public function getSessionNbCourse()
  425. {
  426. return $this->sessionNbCourse;
  427. }
  428. /**
  429. * @param mixed $sessionNbCourse
  430. */
  431. public function setSessionNbCourse($sessionNbCourse): void
  432. {
  433. $this->sessionNbCourse = $sessionNbCourse;
  434. }
  435. /**
  436. * @return mixed
  437. */
  438. public function getSessionDuration()
  439. {
  440. return $this->sessionDuration;
  441. }
  442. /**
  443. * @param mixed $sessionDuration
  444. */
  445. public function setSessionDuration($sessionDuration): void
  446. {
  447. $this->sessionDuration = $sessionDuration;
  448. }
  449. /**
  450. * @return mixed
  451. */
  452. public function getSessionSeats()
  453. {
  454. return $this->sessionSeats;
  455. }
  456. /**
  457. * @param mixed $sessionSeats
  458. */
  459. public function setSessionSeats($sessionSeats): void
  460. {
  461. $this->sessionSeats = $sessionSeats;
  462. }
  463. public function getSessionNbCourseMinByWeek(): int
  464. {
  465. return $this->sessionNbCourseMinByWeek;
  466. }
  467. public function setSessionNbCourseMinByWeek($sessionNbCourseMinByWeek)
  468. {
  469. $this->sessionNbCourseMinByWeek = $sessionNbCourseMinByWeek;
  470. return $this;
  471. }
  472. public function getOrder()
  473. {
  474. return $this->order;
  475. }
  476. public function setOrder($order)
  477. {
  478. $this->order = $order;
  479. return $this;
  480. }
  481. }