src/Entity/Module.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ModuleRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. use Gedmo\Mapping\Annotation as Gedmo;
  8. use JMS\Serializer\Annotation as Serializer;
  9. /**
  10. * @ORM\Entity(repositoryClass=ModuleRepository::class)
  11. * @Serializer\ExclusionPolicy("ALL")
  12. */
  13. class Module extends BaseEntity
  14. {
  15. /**
  16. * @ORM\Id
  17. * @ORM\GeneratedValue
  18. * @ORM\Column(type="integer")
  19. * @Serializer\Expose
  20. * @Serializer\Groups({"participation"})
  21. */
  22. private $id;
  23. /**
  24. * @ORM\Column(type="string", length=255)
  25. * @Serializer\Expose
  26. * @Serializer\Groups({"historic", "participation", "live_details"})
  27. */
  28. private $name;
  29. /**
  30. * @ORM\Column(type="text", nullable=true)
  31. * @Serializer\Expose
  32. */
  33. private $description;
  34. /**
  35. * @ORM\ManyToMany(targetEntity=Taxonomy::class, inversedBy="modules")
  36. */
  37. private $taxonomies;
  38. /**
  39. * @ORM\Column(type="text", nullable=true)
  40. * @Serializer\Expose
  41. */
  42. private $objective;
  43. /**
  44. * @ORM\OneToMany(targetEntity=LearningProgress::class, mappedBy="module", cascade={"remove"}, fetch="EXTRA_LAZY")
  45. */
  46. private $learningProgress;
  47. /**
  48. * @ORM\Column(type="string", length=255, nullable=true)
  49. * @Serializer\Expose
  50. */
  51. private $label;
  52. /**
  53. * @ORM\Column(type="datetime", nullable=true)
  54. * @Serializer\Expose
  55. */
  56. private $startAt;
  57. /**
  58. * @ORM\Column(type="datetime", nullable=true)
  59. * @Serializer\Expose
  60. * @Serializer\Groups({"historic"})
  61. */
  62. private $endAt;
  63. /**
  64. * @ORM\OneToMany(targetEntity=ModuleView::class, mappedBy="module", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
  65. */
  66. private $moduleViews;
  67. /**
  68. * @ORM\OneToMany(targetEntity=ModuleLike::class, mappedBy="module", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
  69. */
  70. private $moduleLikes;
  71. /**
  72. * @ORM\Column(type="datetime", nullable=true)
  73. */
  74. private $publishedAt;
  75. /**
  76. * @ORM\ManyToOne(targetEntity=User::class, inversedBy="modulePublishers")
  77. * @ORM\JoinColumn(name="module_id", referencedColumnName="id", nullable=true, onDelete="SET NULL")
  78. */
  79. private $publishedBy;
  80. /**
  81. * @ORM\Column(type="boolean", nullable=true)
  82. */
  83. private $isPublished = false;
  84. /**
  85. * @ORM\OneToMany(targetEntity=SubsidiaryCompany::class, mappedBy="module", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
  86. */
  87. private $subsidiaryCompanies;
  88. /**
  89. * @ORM\OneToMany(targetEntity=Office::class, mappedBy="module", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
  90. */
  91. private $offices;
  92. /**
  93. * @ORM\OneToMany(targetEntity=Contract::class, mappedBy="module",cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
  94. */
  95. private $contracts;
  96. /**
  97. * @ORM\Column(type="boolean", nullable=true)
  98. */
  99. private $isAllJobs = true;
  100. /**
  101. * @ORM\Column(type="boolean", nullable=true)
  102. */
  103. private $isAllOffices = true;
  104. /**
  105. * @ORM\Column(type="boolean", nullable=true)
  106. */
  107. private $isAllContracts = true;
  108. /**
  109. * @ORM\Column(type="boolean", nullable=true)
  110. */
  111. private $isAllSubsidiaryCompanies = true;
  112. /**
  113. * @Gedmo\Slug(fields={"name"})
  114. * @ORM\Column(length=191)
  115. */
  116. private $slug;
  117. /**
  118. * @ORM\OneToOne(targetEntity=ImageManager::class, cascade={"persist", "remove"})
  119. * @Serializer\Expose
  120. */
  121. private $cover;
  122. /**
  123. * @ORM\OneToMany(targetEntity=ModuleItem::class, mappedBy="module", orphanRemoval="true", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
  124. */
  125. private $moduleItems;
  126. /**
  127. * @ORM\OneToMany(targetEntity=ModuleParticipation::class, mappedBy="module", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
  128. */
  129. private $moduleParticipations;
  130. /**
  131. * @ORM\Column(type="boolean", nullable=true)
  132. */
  133. private $isPublic;
  134. /**
  135. * @ORM\ManyToMany(targetEntity=User::class, inversedBy="modules")
  136. * @ORM\JoinColumn(onDelete="CASCADE")
  137. * @Serializer\Expose
  138. */
  139. private $coaches;
  140. /**
  141. * @ORM\OneToMany(targetEntity=ModuleComment::class, mappedBy="module", cascade={"remove"}, fetch="EXTRA_LAZY")
  142. */
  143. private $moduleComments;
  144. /**
  145. * @ORM\OneToMany(targetEntity=ModuleNotice::class, mappedBy="module", cascade={"remove"}, fetch="EXTRA_LAZY")
  146. */
  147. private $moduleNotices;
  148. /**
  149. * @ORM\OneToMany(targetEntity=Subject::class, mappedBy="module", cascade={"remove"}, fetch="EXTRA_LAZY")
  150. */
  151. private $subjects;
  152. /**
  153. * @ORM\ManyToMany(targetEntity=Program::class, mappedBy="modules")
  154. */
  155. private $programs;
  156. /**
  157. * @ORM\OneToMany(targetEntity=ModuleInscription::class, mappedBy="module", cascade={"remove"}, fetch="EXTRA_LAZY")
  158. */
  159. private $moduleInscriptions;
  160. /**
  161. * @ORM\OneToMany(targetEntity=UserModuleParticipation::class, mappedBy="module", cascade={"remove"}, fetch="EXTRA_LAZY")
  162. */
  163. private $userModuleParticipations;
  164. /**
  165. * @ORM\ManyToMany(targetEntity=Course::class, mappedBy="modules")
  166. */
  167. private $courses;
  168. /**
  169. * @ORM\ManyToMany(targetEntity=Live::class, mappedBy="modules")
  170. */
  171. private $lives;
  172. /**
  173. * @ORM\ManyToMany(targetEntity=Quiz::class, mappedBy="modules")
  174. */
  175. private $quiz;
  176. /**
  177. * @ORM\Column(type="boolean", nullable=true)
  178. */
  179. private $isMadeVisible;
  180. /**
  181. * @ORM\OneToMany(targetEntity=UserQuizQuestion::class, mappedBy="module", cascade={"remove"}, fetch="EXTRA_LAZY")
  182. */
  183. private $userQuizQuestions;
  184. /**
  185. * @ORM\ManyToOne(targetEntity=Partenaire::class)
  186. */
  187. private $partenaire;
  188. /**
  189. * @ORM\Column(type="boolean", nullable=true)
  190. */
  191. private $isAuthoredByCofina;
  192. /**
  193. * @ORM\OneToMany(targetEntity=Notification::class, mappedBy="module", cascade={"remove"}, fetch="EXTRA_LAZY")
  194. */
  195. private $notifications;
  196. /**
  197. * @ORM\ManyToMany(targetEntity=Job::class, inversedBy="modules")
  198. */
  199. private $jobs;
  200. /**
  201. * @ORM\OneToMany(targetEntity=ModuleObjective::class, mappedBy="module", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
  202. */
  203. private $moduleObjectives;
  204. /**
  205. * @ORM\OneToMany(targetEntity=FeaturedModule::class, mappedBy="star", cascade={"persist", "remove"}, fetch="EXTRA_LAZY")
  206. */
  207. private $featuredModules;
  208. /**
  209. * @ORM\OneToMany(targetEntity=Target::class, mappedBy="module", cascade={"remove"}, fetch="EXTRA_LAZY")
  210. */
  211. private $targets;
  212. public function __construct()
  213. {
  214. $this->taxonomies = new ArrayCollection();
  215. $this->learningProgress = new ArrayCollection();
  216. $this->moduleViews = new ArrayCollection();
  217. $this->moduleLikes = new ArrayCollection();
  218. $this->subsidiaryCompanies = new ArrayCollection();
  219. $this->offices = new ArrayCollection();
  220. $this->contracts = new ArrayCollection();
  221. $this->moduleItems = new ArrayCollection();
  222. $this->moduleParticipations = new ArrayCollection();
  223. $this->coaches = new ArrayCollection();
  224. $this->moduleComments = new ArrayCollection();
  225. $this->moduleNotices = new ArrayCollection();
  226. $this->subjects = new ArrayCollection();
  227. $this->programs = new ArrayCollection();
  228. $this->moduleInscriptions = new ArrayCollection();
  229. $this->userModuleParticipations = new ArrayCollection();
  230. $this->courses = new ArrayCollection();
  231. $this->lives = new ArrayCollection();
  232. $this->quiz = new ArrayCollection();
  233. $this->userQuizQuestions = new ArrayCollection();
  234. $this->notifications = new ArrayCollection();
  235. $this->jobs = new ArrayCollection();
  236. $this->moduleObjectives = new ArrayCollection();
  237. $this->featuredModules = new ArrayCollection();
  238. $this->targets = new ArrayCollection();
  239. }
  240. public function getId(): ?int
  241. {
  242. return $this->id;
  243. }
  244. public function getName(): ?string
  245. {
  246. return $this->name;
  247. }
  248. public function setName(string $name): self
  249. {
  250. $this->name = $name;
  251. return $this;
  252. }
  253. public function getDescription(): ?string
  254. {
  255. return $this->description;
  256. }
  257. public function setDescription(?string $description): self
  258. {
  259. $this->description = $description;
  260. return $this;
  261. }
  262. /**
  263. * @return Collection<int, Taxonomy>
  264. */
  265. public function getTaxonomies(): Collection
  266. {
  267. return $this->taxonomies;
  268. }
  269. public function addTaxonomy(Taxonomy $taxonomy): self
  270. {
  271. if (!$this->taxonomies->contains($taxonomy)) {
  272. $this->taxonomies[] = $taxonomy;
  273. }
  274. return $this;
  275. }
  276. public function removeTaxonomy(Taxonomy $taxonomy): self
  277. {
  278. $this->taxonomies->removeElement($taxonomy);
  279. return $this;
  280. }
  281. public function getObjective(): ?string
  282. {
  283. return $this->objective;
  284. }
  285. public function setObjective(?string $objective): self
  286. {
  287. $this->objective = $objective;
  288. return $this;
  289. }
  290. /**
  291. * @return Collection<int, LearningProgress>
  292. */
  293. public function getLearningProgress(): Collection
  294. {
  295. return $this->learningProgress;
  296. }
  297. public function addLearningProgress(LearningProgress $learningProgress): self
  298. {
  299. if (!$this->learningProgress->contains($learningProgress)) {
  300. $this->learningProgress[] = $learningProgress;
  301. $learningProgress->setModule($this);
  302. }
  303. return $this;
  304. }
  305. public function removeLearningProgress(LearningProgress $learningProgress): self
  306. {
  307. if ($this->learningProgress->removeElement($learningProgress)) {
  308. // set the owning side to null (unless already changed)
  309. if ($learningProgress->getModule() === $this) {
  310. $learningProgress->setModule(null);
  311. }
  312. }
  313. return $this;
  314. }
  315. public function getLabel(): ?string
  316. {
  317. return $this->label;
  318. }
  319. public function setLabel(?string $label): self
  320. {
  321. $this->label = $label;
  322. return $this;
  323. }
  324. public function getStartAt(): ?\DateTimeInterface
  325. {
  326. return $this->startAt;
  327. }
  328. public function setStartAt(?\DateTimeInterface $startAt): self
  329. {
  330. $this->startAt = $startAt;
  331. return $this;
  332. }
  333. public function getEndAt(): ?\DateTimeInterface
  334. {
  335. return $this->endAt;
  336. }
  337. public function setEndAt(?\DateTimeInterface $endAt): self
  338. {
  339. $this->endAt = $endAt;
  340. return $this;
  341. }
  342. /**
  343. * @return Collection<int, ModuleView>
  344. */
  345. public function getModuleViews(): Collection
  346. {
  347. return $this->moduleViews;
  348. }
  349. public function addModuleView(ModuleView $moduleView): self
  350. {
  351. if (!$this->moduleViews->contains($moduleView)) {
  352. $this->moduleViews[] = $moduleView;
  353. $moduleView->setModule($this);
  354. }
  355. return $this;
  356. }
  357. public function removeModuleView(ModuleView $moduleView): self
  358. {
  359. if ($this->moduleViews->removeElement($moduleView)) {
  360. // set the owning side to null (unless already changed)
  361. if ($moduleView->getModule() === $this) {
  362. $moduleView->setModule(null);
  363. }
  364. }
  365. return $this;
  366. }
  367. /**
  368. * @return Collection<int, ModuleLike>
  369. */
  370. public function getModuleLikes(): Collection
  371. {
  372. return $this->moduleLikes;
  373. }
  374. public function addModuleLike(ModuleLike $moduleLike): self
  375. {
  376. if (!$this->moduleLikes->contains($moduleLike)) {
  377. $this->moduleLikes[] = $moduleLike;
  378. $moduleLike->setModule($this);
  379. }
  380. return $this;
  381. }
  382. public function removeModuleLike(ModuleLike $moduleLike): self
  383. {
  384. if ($this->moduleLikes->removeElement($moduleLike)) {
  385. // set the owning side to null (unless already changed)
  386. if ($moduleLike->getModule() === $this) {
  387. $moduleLike->setModule(null);
  388. }
  389. }
  390. return $this;
  391. }
  392. public function getPublishedAt(): ?\DateTimeInterface
  393. {
  394. return $this->publishedAt;
  395. }
  396. public function setPublishedAt(?\DateTimeInterface $publishedAt): self
  397. {
  398. $this->publishedAt = $publishedAt;
  399. return $this;
  400. }
  401. public function getPublishedBy(): ?User
  402. {
  403. return $this->publishedBy;
  404. }
  405. public function setPublishedBy(?User $publishedBy): self
  406. {
  407. $this->publishedBy = $publishedBy;
  408. return $this;
  409. }
  410. public function isIsPublished(): ?bool
  411. {
  412. return $this->isPublished;
  413. }
  414. public function setIsPublished(?bool $isPublished): self
  415. {
  416. $this->isPublished = $isPublished;
  417. return $this;
  418. }
  419. /**
  420. * @return Collection<int, SubsidiaryCompany>
  421. */
  422. public function getSubsidiaryCompanies(): Collection
  423. {
  424. return $this->subsidiaryCompanies;
  425. }
  426. public function addSubsidiaryCompany(SubsidiaryCompany $subsidiaryCompany): self
  427. {
  428. if (!$this->subsidiaryCompanies->contains($subsidiaryCompany)) {
  429. $this->subsidiaryCompanies[] = $subsidiaryCompany;
  430. $subsidiaryCompany->setModule($this);
  431. }
  432. return $this;
  433. }
  434. public function removeSubsidiaryCompany(SubsidiaryCompany $subsidiaryCompany): self
  435. {
  436. if ($this->subsidiaryCompanies->removeElement($subsidiaryCompany)) {
  437. // set the owning side to null (unless already changed)
  438. if ($subsidiaryCompany->getModule() === $this) {
  439. $subsidiaryCompany->setModule(null);
  440. }
  441. }
  442. return $this;
  443. }
  444. /**
  445. * @return Collection<int, Office>
  446. */
  447. public function getOffices(): Collection
  448. {
  449. return $this->offices;
  450. }
  451. public function addOffice(Office $office): self
  452. {
  453. if (!$this->offices->contains($office)) {
  454. $this->offices[] = $office;
  455. $office->setModule($this);
  456. }
  457. return $this;
  458. }
  459. public function removeOffice(Office $office): self
  460. {
  461. if ($this->offices->removeElement($office)) {
  462. // set the owning side to null (unless already changed)
  463. if ($office->getModule() === $this) {
  464. $office->setModule(null);
  465. }
  466. }
  467. return $this;
  468. }
  469. /**
  470. * @return Collection<int, Contract>
  471. */
  472. public function getContracts(): Collection
  473. {
  474. return $this->contracts;
  475. }
  476. public function addContract(Contract $contract): self
  477. {
  478. if (!$this->contracts->contains($contract)) {
  479. $this->contracts[] = $contract;
  480. $contract->setModule($this);
  481. }
  482. return $this;
  483. }
  484. public function removeContract(Contract $contract): self
  485. {
  486. if ($this->contracts->removeElement($contract)) {
  487. // set the owning side to null (unless already changed)
  488. if ($contract->getModule() === $this) {
  489. $contract->setModule(null);
  490. }
  491. }
  492. return $this;
  493. }
  494. public function isIsAllJobs(): ?bool
  495. {
  496. return $this->isAllJobs;
  497. }
  498. public function setIsAllJobs(?bool $isAllJobs): self
  499. {
  500. $this->isAllJobs = $isAllJobs;
  501. return $this;
  502. }
  503. public function isIsAllOffices(): ?bool
  504. {
  505. return $this->isAllOffices;
  506. }
  507. public function setIsAllOffices(?bool $isAllOffices): self
  508. {
  509. $this->isAllOffices = $isAllOffices;
  510. return $this;
  511. }
  512. public function isIsAllContracts(): ?bool
  513. {
  514. return $this->isAllContracts;
  515. }
  516. public function setIsAllContracts(?bool $isAllContracts): self
  517. {
  518. $this->isAllContracts = $isAllContracts;
  519. return $this;
  520. }
  521. public function isIsAllSubsidiaryCompanies(): ?bool
  522. {
  523. return $this->isAllSubsidiaryCompanies;
  524. }
  525. public function setIsAllSubsidiaryCompanies(?bool $isAllSubsidiaryCompanies): self
  526. {
  527. $this->isAllSubsidiaryCompanies = $isAllSubsidiaryCompanies;
  528. return $this;
  529. }
  530. /**
  531. * Get the value of slug
  532. */
  533. public function getSlug()
  534. {
  535. return $this->slug;
  536. }
  537. /**
  538. * Set the value of slug
  539. *
  540. * @return self
  541. */
  542. public function setSlug($slug)
  543. {
  544. $this->slug = $slug;
  545. return $this;
  546. }
  547. public function getCover(): ?ImageManager
  548. {
  549. return $this->cover;
  550. }
  551. public function setCover(?ImageManager $cover): self
  552. {
  553. $this->cover = $cover;
  554. return $this;
  555. }
  556. /**
  557. * @return Collection<int, ModuleItem>
  558. */
  559. public function getModuleItems(): Collection
  560. {
  561. return $this->moduleItems;
  562. }
  563. public function addModuleItem(ModuleItem $moduleItem): self
  564. {
  565. if (!$this->moduleItems->contains($moduleItem)) {
  566. $this->moduleItems[] = $moduleItem;
  567. $moduleItem->setModule($this);
  568. }
  569. return $this;
  570. }
  571. public function removeModuleItem(ModuleItem $moduleItem): self
  572. {
  573. if ($this->moduleItems->removeElement($moduleItem)) {
  574. // set the owning side to null (unless already changed)
  575. if ($moduleItem->getModule() === $this) {
  576. $moduleItem->setModule(null);
  577. }
  578. }
  579. return $this;
  580. }
  581. /**
  582. * @return Collection<int, ModuleParticipation>
  583. */
  584. public function getModuleParticipations(): Collection
  585. {
  586. return $this->moduleParticipations;
  587. }
  588. public function addModuleParticipation(ModuleParticipation $moduleParticipation): self
  589. {
  590. if (!$this->moduleParticipations->contains($moduleParticipation)) {
  591. $this->moduleParticipations[] = $moduleParticipation;
  592. $moduleParticipation->setModule($this);
  593. }
  594. return $this;
  595. }
  596. public function removeModuleParticipation(ModuleParticipation $moduleParticipation): self
  597. {
  598. if ($this->moduleParticipations->removeElement($moduleParticipation)) {
  599. // set the owning side to null (unless already changed)
  600. if ($moduleParticipation->getModule() === $this) {
  601. $moduleParticipation->setModule(null);
  602. }
  603. }
  604. return $this;
  605. }
  606. public function isIsPublic(): ?bool
  607. {
  608. return $this->isPublic;
  609. }
  610. public function setIsPublic(?bool $isPublic): self
  611. {
  612. $this->isPublic = $isPublic;
  613. return $this;
  614. }
  615. /**
  616. * @return Collection<int, User>
  617. */
  618. public function getCoaches(): Collection
  619. {
  620. return $this->coaches;
  621. }
  622. public function addCoach(User $coach): self
  623. {
  624. if (!$this->coaches->contains($coach)) {
  625. $this->coaches[] = $coach;
  626. }
  627. return $this;
  628. }
  629. public function removeCoach(User $coach): self
  630. {
  631. $this->coaches->removeElement($coach);
  632. return $this;
  633. }
  634. /**
  635. * @return Collection<int, ModuleComment>
  636. */
  637. public function getModuleComments(): Collection
  638. {
  639. return $this->moduleComments;
  640. }
  641. public function addModuleComment(ModuleComment $moduleComment): self
  642. {
  643. if (!$this->moduleComments->contains($moduleComment)) {
  644. $this->moduleComments[] = $moduleComment;
  645. $moduleComment->setModule($this);
  646. }
  647. return $this;
  648. }
  649. public function removeModuleComment(ModuleComment $moduleComment): self
  650. {
  651. if ($this->moduleComments->removeElement($moduleComment)) {
  652. // set the owning side to null (unless already changed)
  653. if ($moduleComment->getModule() === $this) {
  654. $moduleComment->setModule(null);
  655. }
  656. }
  657. return $this;
  658. }
  659. /**
  660. * @return Collection<int, ModuleNotice>
  661. */
  662. public function getModuleNotices(): Collection
  663. {
  664. return $this->moduleNotices;
  665. }
  666. public function addModuleNotice(ModuleNotice $moduleNotice): self
  667. {
  668. if (!$this->moduleNotices->contains($moduleNotice)) {
  669. $this->moduleNotices[] = $moduleNotice;
  670. $moduleNotice->setModule($this);
  671. }
  672. return $this;
  673. }
  674. public function removeModuleNotice(ModuleNotice $moduleNotice): self
  675. {
  676. if ($this->moduleNotices->removeElement($moduleNotice)) {
  677. // set the owning side to null (unless already changed)
  678. if ($moduleNotice->getModule() === $this) {
  679. $moduleNotice->setModule(null);
  680. }
  681. }
  682. return $this;
  683. }
  684. /**
  685. * @return Collection<int, Subject>
  686. */
  687. public function getSubjects(): Collection
  688. {
  689. return $this->subjects;
  690. }
  691. public function addSubject(Subject $subject): self
  692. {
  693. if (!$this->subjects->contains($subject)) {
  694. $this->subjects[] = $subject;
  695. $subject->setModule($this);
  696. }
  697. return $this;
  698. }
  699. public function removeSubject(Subject $subject): self
  700. {
  701. if ($this->subjects->removeElement($subject)) {
  702. // set the owning side to null (unless already changed)
  703. if ($subject->getModule() === $this) {
  704. $subject->setModule(null);
  705. }
  706. }
  707. return $this;
  708. }
  709. /**
  710. * @return Collection<int, Program>
  711. */
  712. public function getPrograms(): Collection
  713. {
  714. return $this->programs;
  715. }
  716. public function addProgram(Program $program): self
  717. {
  718. if (!$this->programs->contains($program)) {
  719. $this->programs[] = $program;
  720. $program->addModule($this);
  721. }
  722. return $this;
  723. }
  724. public function removeProgram(Program $program): self
  725. {
  726. if ($this->programs->removeElement($program)) {
  727. $program->removeModule($this);
  728. }
  729. return $this;
  730. }
  731. /**
  732. * @return Collection<int, ModuleInscription>
  733. */
  734. public function getModuleInscriptions(): Collection
  735. {
  736. return $this->moduleInscriptions;
  737. }
  738. public function addModuleInscription(ModuleInscription $moduleInscription): self
  739. {
  740. if (!$this->moduleInscriptions->contains($moduleInscription)) {
  741. $this->moduleInscriptions[] = $moduleInscription;
  742. $moduleInscription->setModule($this);
  743. }
  744. return $this;
  745. }
  746. public function removeModuleInscription(ModuleInscription $moduleInscription): self
  747. {
  748. if ($this->moduleInscriptions->removeElement($moduleInscription)) {
  749. // set the owning side to null (unless already changed)
  750. if ($moduleInscription->getModule() === $this) {
  751. $moduleInscription->setModule(null);
  752. }
  753. }
  754. return $this;
  755. }
  756. /**
  757. * @return Collection<int, UserModuleParticipation>
  758. */
  759. public function getUserModuleParticipations(): Collection
  760. {
  761. return $this->userModuleParticipations;
  762. }
  763. public function addUserModuleParticipation(UserModuleParticipation $userModuleParticipation): self
  764. {
  765. if (!$this->userModuleParticipations->contains($userModuleParticipation)) {
  766. $this->userModuleParticipations[] = $userModuleParticipation;
  767. $userModuleParticipation->setModule($this);
  768. }
  769. return $this;
  770. }
  771. public function removeUserModuleParticipation(UserModuleParticipation $userModuleParticipation): self
  772. {
  773. if ($this->userModuleParticipations->removeElement($userModuleParticipation)) {
  774. // set the owning side to null (unless already changed)
  775. if ($userModuleParticipation->getModule() === $this) {
  776. $userModuleParticipation->setModule(null);
  777. }
  778. }
  779. return $this;
  780. }
  781. /**
  782. * @return Collection<int, Course>
  783. */
  784. public function getCourses(): Collection
  785. {
  786. return $this->courses;
  787. }
  788. public function addCourse(Course $course): self
  789. {
  790. if (!$this->courses->contains($course)) {
  791. $this->courses[] = $course;
  792. $course->addModule($this);
  793. }
  794. return $this;
  795. }
  796. public function removeCourse(Course $course): self
  797. {
  798. if ($this->courses->removeElement($course)) {
  799. $course->removeModule($this);
  800. }
  801. return $this;
  802. }
  803. /**
  804. * @return Collection<int, Live>
  805. */
  806. public function getLives(): Collection
  807. {
  808. return $this->lives;
  809. }
  810. public function addLife(Live $life): self
  811. {
  812. if (!$this->lives->contains($life)) {
  813. $this->lives[] = $life;
  814. $life->addModule($this);
  815. }
  816. return $this;
  817. }
  818. public function removeLife(Live $life): self
  819. {
  820. if ($this->lives->removeElement($life)) {
  821. $life->removeModule($this);
  822. }
  823. return $this;
  824. }
  825. /**
  826. * @return Collection<int, Quiz>
  827. */
  828. public function getQuiz(): Collection
  829. {
  830. return $this->quiz;
  831. }
  832. public function addQuiz(Quiz $quiz): self
  833. {
  834. if (!$this->quiz->contains($quiz)) {
  835. $this->quiz[] = $quiz;
  836. $quiz->addModule($this);
  837. }
  838. return $this;
  839. }
  840. public function removeQuiz(Quiz $quiz): self
  841. {
  842. if ($this->quiz->removeElement($quiz)) {
  843. $quiz->removeModule($this);
  844. }
  845. return $this;
  846. }
  847. public function isIsMadeVisible(): ?bool
  848. {
  849. return $this->isMadeVisible;
  850. }
  851. public function setIsMadeVisible(?bool $isMadeVisible): self
  852. {
  853. $this->isMadeVisible = $isMadeVisible;
  854. return $this;
  855. }
  856. /**
  857. * @return Collection<int, UserQuizQuestion>
  858. */
  859. public function getUserQuizQuestions(): Collection
  860. {
  861. return $this->userQuizQuestions;
  862. }
  863. public function addUserQuizQuestion(UserQuizQuestion $userQuizQuestion): self
  864. {
  865. if (!$this->userQuizQuestions->contains($userQuizQuestion)) {
  866. $this->userQuizQuestions[] = $userQuizQuestion;
  867. $userQuizQuestion->setModule($this);
  868. }
  869. return $this;
  870. }
  871. public function removeUserQuizQuestion(UserQuizQuestion $userQuizQuestion): self
  872. {
  873. if ($this->userQuizQuestions->removeElement($userQuizQuestion)) {
  874. // set the owning side to null (unless already changed)
  875. if ($userQuizQuestion->getModule() === $this) {
  876. $userQuizQuestion->setModule(null);
  877. }
  878. }
  879. return $this;
  880. }
  881. public function getPartenaire(): ?Partenaire
  882. {
  883. return $this->partenaire;
  884. }
  885. public function setPartenaire(?Partenaire $partenaire): self
  886. {
  887. $this->partenaire = $partenaire;
  888. return $this;
  889. }
  890. public function isIsAuthoredByCofina(): ?bool
  891. {
  892. return $this->isAuthoredByCofina;
  893. }
  894. public function setIsAuthoredByCofina(?bool $isAuthoredByCofina): self
  895. {
  896. $this->isAuthoredByCofina = $isAuthoredByCofina;
  897. return $this;
  898. }
  899. /**
  900. * @return Collection<int, Notification>
  901. */
  902. public function getNotifications(): Collection
  903. {
  904. return $this->notifications;
  905. }
  906. public function addNotification(Notification $notification): self
  907. {
  908. if (!$this->notifications->contains($notification)) {
  909. $this->notifications[] = $notification;
  910. $notification->setModule($this);
  911. }
  912. return $this;
  913. }
  914. public function removeNotification(Notification $notification): self
  915. {
  916. if ($this->notifications->removeElement($notification)) {
  917. // set the owning side to null (unless already changed)
  918. if ($notification->getModule() === $this) {
  919. $notification->setModule(null);
  920. }
  921. }
  922. return $this;
  923. }
  924. /**
  925. * @return Collection<int, Job>
  926. */
  927. public function getJobs(): Collection
  928. {
  929. return $this->jobs;
  930. }
  931. public function addJob(Job $job): self
  932. {
  933. if (!$this->jobs->contains($job)) {
  934. $this->jobs[] = $job;
  935. }
  936. return $this;
  937. }
  938. public function removeJob(Job $job): self
  939. {
  940. $this->jobs->removeElement($job);
  941. return $this;
  942. }
  943. /**
  944. * @return Collection<int, ModuleObjectives>
  945. */
  946. public function getModuleObjectives(): Collection
  947. {
  948. return $this->moduleObjectives;
  949. }
  950. public function addModuleObjective(ModuleObjective $moduleObjective): self
  951. {
  952. if (!$this->moduleObjectives->contains($moduleObjective)) {
  953. $this->moduleObjectives[] = $moduleObjective;
  954. $moduleObjective->setModule($this);
  955. }
  956. return $this;
  957. }
  958. public function removeModuleObjective(ModuleObjective $moduleObjective): self
  959. {
  960. if ($this->moduleObjectives->removeElement($moduleObjective)) {
  961. // set the owning side to null (unless already changed)
  962. if ($moduleObjective->getModule() === $this) {
  963. $moduleObjective->setModule(null);
  964. }
  965. }
  966. return $this;
  967. }
  968. /**
  969. * @return Collection<int, FeaturedModule>
  970. */
  971. public function getFeaturedModules(): Collection
  972. {
  973. return $this->moduleObjectives;
  974. }
  975. public function addFeaturedModule(FeaturedModule $featuredModule): self
  976. {
  977. if (!$this->featuredModules->contains($featuredModule)) {
  978. $this->featuredModules[] = $featuredModule;
  979. $featuredModule->setStar($this);
  980. }
  981. return $this;
  982. }
  983. public function removeFeaturedModule(FeaturedModule $featuredModule): self
  984. {
  985. if ($this->featuredModules->removeElement($featuredModule)) {
  986. // set the owning side to null (unless already changed)
  987. if ($featuredModule->getStar() === $this) {
  988. $featuredModule->setStar(null);
  989. }
  990. }
  991. return $this;
  992. }
  993. /**
  994. * @return Collection<int, Target>
  995. */
  996. public function getTarges(): Collection
  997. {
  998. return $this->targets;
  999. }
  1000. public function addTarget(Target $target): self
  1001. {
  1002. if (!$this->targets->contains($target)) {
  1003. $this->targets[] = $target;
  1004. $target->setModule($this);
  1005. }
  1006. return $this;
  1007. }
  1008. public function removeTarget(Target $target): self
  1009. {
  1010. if ($this->targets->removeElement($target)) {
  1011. // set the owning side to null (unless already changed)
  1012. if ($target->getModule() === $this) {
  1013. $target->setModule(null);
  1014. }
  1015. }
  1016. return $this;
  1017. }
  1018. }