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", cascade={"remove"})
  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"})
  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"})
  65.      */
  66.     private $moduleViews;
  67.     /**
  68.      * @ORM\OneToMany(targetEntity=ModuleLike::class, mappedBy="module", cascade={"persist"})
  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"})
  86.      */
  87.     private $subsidiaryCompanies;
  88.     /**
  89.      * @ORM\OneToMany(targetEntity=Office::class, mappedBy="module", cascade={"persist"})
  90.      */
  91.     private $offices;
  92.     /**
  93.      * @ORM\OneToMany(targetEntity=Contract::class, mappedBy="module",cascade={"persist"})
  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"})
  124.      */
  125.     private $moduleItems;
  126.     /**
  127.      * @ORM\OneToMany(targetEntity=ModuleParticipation::class, mappedBy="module", cascade={"persist"})
  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")
  142.      */
  143.     private $moduleComments;
  144.     /**
  145.      * @ORM\OneToMany(targetEntity=ModuleNotice::class, mappedBy="module")
  146.      */
  147.     private $moduleNotices;
  148.     /**
  149.      * @ORM\OneToMany(targetEntity=Subject::class, mappedBy="module")
  150.      */
  151.     private $subjects;
  152.     /**
  153.      * @ORM\ManyToMany(targetEntity=Program::class, mappedBy="modules", cascade={"remove"})
  154.      */
  155.     private $programs;
  156.     /**
  157.      * @ORM\OneToMany(targetEntity=ModuleInscription::class, mappedBy="module")
  158.      */
  159.     private $moduleInscriptions;
  160.     /**
  161.      * @ORM\OneToMany(targetEntity=UserModuleParticipation::class, mappedBy="module")
  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")
  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")
  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"})
  202.      */
  203.     private $moduleObjectives;
  204.     public function __construct()
  205.     {
  206.         $this->taxonomies = new ArrayCollection();
  207.         $this->learningProgress = new ArrayCollection();
  208.         $this->moduleViews = new ArrayCollection();
  209.         $this->moduleLikes = new ArrayCollection();
  210.         $this->subsidiaryCompanies = new ArrayCollection();
  211.         $this->offices = new ArrayCollection();
  212.         $this->contracts = new ArrayCollection();
  213.         $this->moduleItems = new ArrayCollection();
  214.         $this->moduleParticipations = new ArrayCollection();
  215.         $this->coaches = new ArrayCollection();
  216.         $this->moduleComments = new ArrayCollection();
  217.         $this->moduleNotices = new ArrayCollection();
  218.         $this->subjects = new ArrayCollection();
  219.         $this->programs = new ArrayCollection();
  220.         $this->moduleInscriptions = new ArrayCollection();
  221.         $this->userModuleParticipations = new ArrayCollection();
  222.         $this->courses = new ArrayCollection();
  223.         $this->lives = new ArrayCollection();
  224.         $this->quiz = new ArrayCollection();
  225.         $this->userQuizQuestions = new ArrayCollection();
  226.         $this->notifications = new ArrayCollection();
  227.         $this->jobs = new ArrayCollection();
  228.         $this->moduleObjectives = new ArrayCollection();
  229.     }
  230.     public function getId(): ?int
  231.     {
  232.         return $this->id;
  233.     }
  234.     public function getName(): ?string
  235.     {
  236.         return $this->name;
  237.     }
  238.     public function setName(string $name): self
  239.     {
  240.         $this->name $name;
  241.         return $this;
  242.     }
  243.     public function getDescription(): ?string
  244.     {
  245.         return $this->description;
  246.     }
  247.     public function setDescription(?string $description): self
  248.     {
  249.         $this->description $description;
  250.         return $this;
  251.     }
  252.     /**
  253.      * @return Collection<int, Taxonomy>
  254.      */
  255.     public function getTaxonomies(): Collection
  256.     {
  257.         return $this->taxonomies;
  258.     }
  259.     public function addTaxonomy(Taxonomy $taxonomy): self
  260.     {
  261.         if (!$this->taxonomies->contains($taxonomy)) {
  262.             $this->taxonomies[] = $taxonomy;
  263.         }
  264.         return $this;
  265.     }
  266.     public function removeTaxonomy(Taxonomy $taxonomy): self
  267.     {
  268.         $this->taxonomies->removeElement($taxonomy);
  269.         return $this;
  270.     }
  271.     public function getObjective(): ?string
  272.     {
  273.         return $this->objective;
  274.     }
  275.     public function setObjective(?string $objective): self
  276.     {
  277.         $this->objective $objective;
  278.         return $this;
  279.     }
  280.     /**
  281.      * @return Collection<int, LearningProgress>
  282.      */
  283.     public function getLearningProgress(): Collection
  284.     {
  285.         return $this->learningProgress;
  286.     }
  287.     public function addLearningProgress(LearningProgress $learningProgress): self
  288.     {
  289.         if (!$this->learningProgress->contains($learningProgress)) {
  290.             $this->learningProgress[] = $learningProgress;
  291.             $learningProgress->setModule($this);
  292.         }
  293.         return $this;
  294.     }
  295.     public function removeLearningProgress(LearningProgress $learningProgress): self
  296.     {
  297.         if ($this->learningProgress->removeElement($learningProgress)) {
  298.             // set the owning side to null (unless already changed)
  299.             if ($learningProgress->getModule() === $this) {
  300.                 $learningProgress->setModule(null);
  301.             }
  302.         }
  303.         return $this;
  304.     }
  305.     public function getLabel(): ?string
  306.     {
  307.         return $this->label;
  308.     }
  309.     public function setLabel(?string $label): self
  310.     {
  311.         $this->label $label;
  312.         return $this;
  313.     }
  314.     public function getStartAt(): ?\DateTimeInterface
  315.     {
  316.         return $this->startAt;
  317.     }
  318.     public function setStartAt(?\DateTimeInterface $startAt): self
  319.     {
  320.         $this->startAt $startAt;
  321.         return $this;
  322.     }
  323.     public function getEndAt(): ?\DateTimeInterface
  324.     {
  325.         return $this->endAt;
  326.     }
  327.     public function setEndAt(?\DateTimeInterface $endAt): self
  328.     {
  329.         $this->endAt $endAt;
  330.         return $this;
  331.     }
  332.     /**
  333.      * @return Collection<int, ModuleView>
  334.      */
  335.     public function getModuleViews(): Collection
  336.     {
  337.         return $this->moduleViews;
  338.     }
  339.     public function addModuleView(ModuleView $moduleView): self
  340.     {
  341.         if (!$this->moduleViews->contains($moduleView)) {
  342.             $this->moduleViews[] = $moduleView;
  343.             $moduleView->setModule($this);
  344.         }
  345.         return $this;
  346.     }
  347.     public function removeModuleView(ModuleView $moduleView): self
  348.     {
  349.         if ($this->moduleViews->removeElement($moduleView)) {
  350.             // set the owning side to null (unless already changed)
  351.             if ($moduleView->getModule() === $this) {
  352.                 $moduleView->setModule(null);
  353.             }
  354.         }
  355.         return $this;
  356.     }
  357.     /**
  358.      * @return Collection<int, ModuleLike>
  359.      */
  360.     public function getModuleLikes(): Collection
  361.     {
  362.         return $this->moduleLikes;
  363.     }
  364.     public function addModuleLike(ModuleLike $moduleLike): self
  365.     {
  366.         if (!$this->moduleLikes->contains($moduleLike)) {
  367.             $this->moduleLikes[] = $moduleLike;
  368.             $moduleLike->setModule($this);
  369.         }
  370.         return $this;
  371.     }
  372.     public function removeModuleLike(ModuleLike $moduleLike): self
  373.     {
  374.         if ($this->moduleLikes->removeElement($moduleLike)) {
  375.             // set the owning side to null (unless already changed)
  376.             if ($moduleLike->getModule() === $this) {
  377.                 $moduleLike->setModule(null);
  378.             }
  379.         }
  380.         return $this;
  381.     }
  382.     public function getPublishedAt(): ?\DateTimeInterface
  383.     {
  384.         return $this->publishedAt;
  385.     }
  386.     public function setPublishedAt(?\DateTimeInterface $publishedAt): self
  387.     {
  388.         $this->publishedAt $publishedAt;
  389.         return $this;
  390.     }
  391.     public function getPublishedBy(): ?User
  392.     {
  393.         return $this->publishedBy;
  394.     }
  395.     public function setPublishedBy(?User $publishedBy): self
  396.     {
  397.         $this->publishedBy $publishedBy;
  398.         return $this;
  399.     }
  400.     public function isIsPublished(): ?bool
  401.     {
  402.         return $this->isPublished;
  403.     }
  404.     public function setIsPublished(?bool $isPublished): self
  405.     {
  406.         $this->isPublished $isPublished;
  407.         return $this;
  408.     }
  409.     /**
  410.      * @return Collection<int, SubsidiaryCompany>
  411.      */
  412.     public function getSubsidiaryCompanies(): Collection
  413.     {
  414.         return $this->subsidiaryCompanies;
  415.     }
  416.     public function addSubsidiaryCompany(SubsidiaryCompany $subsidiaryCompany): self
  417.     {
  418.         if (!$this->subsidiaryCompanies->contains($subsidiaryCompany)) {
  419.             $this->subsidiaryCompanies[] = $subsidiaryCompany;
  420.             $subsidiaryCompany->setModule($this);
  421.         }
  422.         return $this;
  423.     }
  424.     public function removeSubsidiaryCompany(SubsidiaryCompany $subsidiaryCompany): self
  425.     {
  426.         if ($this->subsidiaryCompanies->removeElement($subsidiaryCompany)) {
  427.             // set the owning side to null (unless already changed)
  428.             if ($subsidiaryCompany->getModule() === $this) {
  429.                 $subsidiaryCompany->setModule(null);
  430.             }
  431.         }
  432.         return $this;
  433.     }
  434.     /**
  435.      * @return Collection<int, Office>
  436.      */
  437.     public function getOffices(): Collection
  438.     {
  439.         return $this->offices;
  440.     }
  441.     public function addOffice(Office $office): self
  442.     {
  443.         if (!$this->offices->contains($office)) {
  444.             $this->offices[] = $office;
  445.             $office->setModule($this);
  446.         }
  447.         return $this;
  448.     }
  449.     public function removeOffice(Office $office): self
  450.     {
  451.         if ($this->offices->removeElement($office)) {
  452.             // set the owning side to null (unless already changed)
  453.             if ($office->getModule() === $this) {
  454.                 $office->setModule(null);
  455.             }
  456.         }
  457.         return $this;
  458.     }
  459.     /**
  460.      * @return Collection<int, Contract>
  461.      */
  462.     public function getContracts(): Collection
  463.     {
  464.         return $this->contracts;
  465.     }
  466.     public function addContract(Contract $contract): self
  467.     {
  468.         if (!$this->contracts->contains($contract)) {
  469.             $this->contracts[] = $contract;
  470.             $contract->setModule($this);
  471.         }
  472.         return $this;
  473.     }
  474.     public function removeContract(Contract $contract): self
  475.     {
  476.         if ($this->contracts->removeElement($contract)) {
  477.             // set the owning side to null (unless already changed)
  478.             if ($contract->getModule() === $this) {
  479.                 $contract->setModule(null);
  480.             }
  481.         }
  482.         return $this;
  483.     }
  484.     public function isIsAllJobs(): ?bool
  485.     {
  486.         return $this->isAllJobs;
  487.     }
  488.     public function setIsAllJobs(?bool $isAllJobs): self
  489.     {
  490.         $this->isAllJobs $isAllJobs;
  491.         return $this;
  492.     }
  493.     public function isIsAllOffices(): ?bool
  494.     {
  495.         return $this->isAllOffices;
  496.     }
  497.     public function setIsAllOffices(?bool $isAllOffices): self
  498.     {
  499.         $this->isAllOffices $isAllOffices;
  500.         return $this;
  501.     }
  502.     public function isIsAllContracts(): ?bool
  503.     {
  504.         return $this->isAllContracts;
  505.     }
  506.     public function setIsAllContracts(?bool $isAllContracts): self
  507.     {
  508.         $this->isAllContracts $isAllContracts;
  509.         return $this;
  510.     }
  511.     public function isIsAllSubsidiaryCompanies(): ?bool
  512.     {
  513.         return $this->isAllSubsidiaryCompanies;
  514.     }
  515.     public function setIsAllSubsidiaryCompanies(?bool $isAllSubsidiaryCompanies): self
  516.     {
  517.         $this->isAllSubsidiaryCompanies $isAllSubsidiaryCompanies;
  518.         return $this;
  519.     }
  520.     /**
  521.      * Get the value of slug
  522.      */ 
  523.     public function getSlug()
  524.     {
  525.         return $this->slug;
  526.     }
  527.     /**
  528.      * Set the value of slug
  529.      *
  530.      * @return  self
  531.      */ 
  532.     public function setSlug($slug)
  533.     {
  534.         $this->slug $slug;
  535.         return $this;
  536.     }
  537.     public function getCover(): ?ImageManager
  538.     {
  539.         return $this->cover;
  540.     }
  541.     public function setCover(?ImageManager $cover): self
  542.     {
  543.         $this->cover $cover;
  544.         return $this;
  545.     }
  546.     /**
  547.      * @return Collection<int, ModuleItem>
  548.      */
  549.     public function getModuleItems(): Collection
  550.     {
  551.         return $this->moduleItems;
  552.     }
  553.     public function addModuleItem(ModuleItem $moduleItem): self
  554.     {
  555.         if (!$this->moduleItems->contains($moduleItem)) {
  556.             $this->moduleItems[] = $moduleItem;
  557.             $moduleItem->setModule($this);
  558.         }
  559.         return $this;
  560.     }
  561.     public function removeModuleItem(ModuleItem $moduleItem): self
  562.     {
  563.         if ($this->moduleItems->removeElement($moduleItem)) {
  564.             // set the owning side to null (unless already changed)
  565.             if ($moduleItem->getModule() === $this) {
  566.                 $moduleItem->setModule(null);
  567.             }
  568.         }
  569.         return $this;
  570.     }
  571.     /**
  572.      * @return Collection<int, ModuleParticipation>
  573.      */
  574.     public function getModuleParticipations(): Collection
  575.     {
  576.         return $this->moduleParticipations;
  577.     }
  578.     public function addModuleParticipation(ModuleParticipation $moduleParticipation): self
  579.     {
  580.         if (!$this->moduleParticipations->contains($moduleParticipation)) {
  581.             $this->moduleParticipations[] = $moduleParticipation;
  582.             $moduleParticipation->setModule($this);
  583.         }
  584.         return $this;
  585.     }
  586.     public function removeModuleParticipation(ModuleParticipation $moduleParticipation): self
  587.     {
  588.         if ($this->moduleParticipations->removeElement($moduleParticipation)) {
  589.             // set the owning side to null (unless already changed)
  590.             if ($moduleParticipation->getModule() === $this) {
  591.                 $moduleParticipation->setModule(null);
  592.             }
  593.         }
  594.         return $this;
  595.     }
  596.     public function isIsPublic(): ?bool
  597.     {
  598.         return $this->isPublic;
  599.     }
  600.     public function setIsPublic(?bool $isPublic): self
  601.     {
  602.         $this->isPublic $isPublic;
  603.         return $this;
  604.     }
  605.     /**
  606.      * @return Collection<int, User>
  607.      */
  608.     public function getCoaches(): Collection
  609.     {
  610.         return $this->coaches;
  611.     }
  612.     public function addCoach(User $coach): self
  613.     {
  614.         if (!$this->coaches->contains($coach)) {
  615.             $this->coaches[] = $coach;
  616.         }
  617.         return $this;
  618.     }
  619.     public function removeCoach(User $coach): self
  620.     {
  621.         $this->coaches->removeElement($coach);
  622.         return $this;
  623.     }
  624.     /**
  625.      * @return Collection<int, ModuleComment>
  626.      */
  627.     public function getModuleComments(): Collection
  628.     {
  629.         return $this->moduleComments;
  630.     }
  631.     public function addModuleComment(ModuleComment $moduleComment): self
  632.     {
  633.         if (!$this->moduleComments->contains($moduleComment)) {
  634.             $this->moduleComments[] = $moduleComment;
  635.             $moduleComment->setModule($this);
  636.         }
  637.         return $this;
  638.     }
  639.     public function removeModuleComment(ModuleComment $moduleComment): self
  640.     {
  641.         if ($this->moduleComments->removeElement($moduleComment)) {
  642.             // set the owning side to null (unless already changed)
  643.             if ($moduleComment->getModule() === $this) {
  644.                 $moduleComment->setModule(null);
  645.             }
  646.         }
  647.         return $this;
  648.     }
  649.     /**
  650.      * @return Collection<int, ModuleNotice>
  651.      */
  652.     public function getModuleNotices(): Collection
  653.     {
  654.         return $this->moduleNotices;
  655.     }
  656.     public function addModuleNotice(ModuleNotice $moduleNotice): self
  657.     {
  658.         if (!$this->moduleNotices->contains($moduleNotice)) {
  659.             $this->moduleNotices[] = $moduleNotice;
  660.             $moduleNotice->setModule($this);
  661.         }
  662.         return $this;
  663.     }
  664.     public function removeModuleNotice(ModuleNotice $moduleNotice): self
  665.     {
  666.         if ($this->moduleNotices->removeElement($moduleNotice)) {
  667.             // set the owning side to null (unless already changed)
  668.             if ($moduleNotice->getModule() === $this) {
  669.                 $moduleNotice->setModule(null);
  670.             }
  671.         }
  672.         return $this;
  673.     }
  674.     /**
  675.      * @return Collection<int, Subject>
  676.      */
  677.     public function getSubjects(): Collection
  678.     {
  679.         return $this->subjects;
  680.     }
  681.     public function addSubject(Subject $subject): self
  682.     {
  683.         if (!$this->subjects->contains($subject)) {
  684.             $this->subjects[] = $subject;
  685.             $subject->setModule($this);
  686.         }
  687.         return $this;
  688.     }
  689.     public function removeSubject(Subject $subject): self
  690.     {
  691.         if ($this->subjects->removeElement($subject)) {
  692.             // set the owning side to null (unless already changed)
  693.             if ($subject->getModule() === $this) {
  694.                 $subject->setModule(null);
  695.             }
  696.         }
  697.         return $this;
  698.     }
  699.     /**
  700.      * @return Collection<int, Program>
  701.      */
  702.     public function getPrograms(): Collection
  703.     {
  704.         return $this->programs;
  705.     }
  706.     public function addProgram(Program $program): self
  707.     {
  708.         if (!$this->programs->contains($program)) {
  709.             $this->programs[] = $program;
  710.             $program->addModule($this);
  711.         }
  712.         return $this;
  713.     }
  714.     public function removeProgram(Program $program): self
  715.     {
  716.         if ($this->programs->removeElement($program)) {
  717.             $program->removeModule($this);
  718.         }
  719.         return $this;
  720.     }
  721.     /**
  722.      * @return Collection<int, ModuleInscription>
  723.      */
  724.     public function getModuleInscriptions(): Collection
  725.     {
  726.         return $this->moduleInscriptions;
  727.     }
  728.     public function addModuleInscription(ModuleInscription $moduleInscription): self
  729.     {
  730.         if (!$this->moduleInscriptions->contains($moduleInscription)) {
  731.             $this->moduleInscriptions[] = $moduleInscription;
  732.             $moduleInscription->setModule($this);
  733.         }
  734.         return $this;
  735.     }
  736.     public function removeModuleInscription(ModuleInscription $moduleInscription): self
  737.     {
  738.         if ($this->moduleInscriptions->removeElement($moduleInscription)) {
  739.             // set the owning side to null (unless already changed)
  740.             if ($moduleInscription->getModule() === $this) {
  741.                 $moduleInscription->setModule(null);
  742.             }
  743.         }
  744.         return $this;
  745.     }
  746.     /**
  747.      * @return Collection<int, UserModuleParticipation>
  748.      */
  749.     public function getUserModuleParticipations(): Collection
  750.     {
  751.         return $this->userModuleParticipations;
  752.     }
  753.     public function addUserModuleParticipation(UserModuleParticipation $userModuleParticipation): self
  754.     {
  755.         if (!$this->userModuleParticipations->contains($userModuleParticipation)) {
  756.             $this->userModuleParticipations[] = $userModuleParticipation;
  757.             $userModuleParticipation->setModule($this);
  758.         }
  759.         return $this;
  760.     }
  761.     public function removeUserModuleParticipation(UserModuleParticipation $userModuleParticipation): self
  762.     {
  763.         if ($this->userModuleParticipations->removeElement($userModuleParticipation)) {
  764.             // set the owning side to null (unless already changed)
  765.             if ($userModuleParticipation->getModule() === $this) {
  766.                 $userModuleParticipation->setModule(null);
  767.             }
  768.         }
  769.         return $this;
  770.     }
  771.     /**
  772.      * @return Collection<int, Course>
  773.      */
  774.     public function getCourses(): Collection
  775.     {
  776.         return $this->courses;
  777.     }
  778.     public function addCourse(Course $course): self
  779.     {
  780.         if (!$this->courses->contains($course)) {
  781.             $this->courses[] = $course;
  782.             $course->addModule($this);
  783.         }
  784.         return $this;
  785.     }
  786.     public function removeCourse(Course $course): self
  787.     {
  788.         if ($this->courses->removeElement($course)) {
  789.             $course->removeModule($this);
  790.         }
  791.         return $this;
  792.     }
  793.     /**
  794.      * @return Collection<int, Live>
  795.      */
  796.     public function getLives(): Collection
  797.     {
  798.         return $this->lives;
  799.     }
  800.     public function addLife(Live $life): self
  801.     {
  802.         if (!$this->lives->contains($life)) {
  803.             $this->lives[] = $life;
  804.             $life->addModule($this);
  805.         }
  806.         return $this;
  807.     }
  808.     public function removeLife(Live $life): self
  809.     {
  810.         if ($this->lives->removeElement($life)) {
  811.             $life->removeModule($this);
  812.         }
  813.         return $this;
  814.     }
  815.     /**
  816.      * @return Collection<int, Quiz>
  817.      */
  818.     public function getQuiz(): Collection
  819.     {
  820.         return $this->quiz;
  821.     }
  822.     public function addQuiz(Quiz $quiz): self
  823.     {
  824.         if (!$this->quiz->contains($quiz)) {
  825.             $this->quiz[] = $quiz;
  826.             $quiz->addModule($this);
  827.         }
  828.         return $this;
  829.     }
  830.     public function removeQuiz(Quiz $quiz): self
  831.     {
  832.         if ($this->quiz->removeElement($quiz)) {
  833.             $quiz->removeModule($this);
  834.         }
  835.         return $this;
  836.     }
  837.     public function isIsMadeVisible(): ?bool
  838.     {
  839.         return $this->isMadeVisible;
  840.     }
  841.     public function setIsMadeVisible(?bool $isMadeVisible): self
  842.     {
  843.         $this->isMadeVisible $isMadeVisible;
  844.         return $this;
  845.     }
  846.     /**
  847.      * @return Collection<int, UserQuizQuestion>
  848.      */
  849.     public function getUserQuizQuestions(): Collection
  850.     {
  851.         return $this->userQuizQuestions;
  852.     }
  853.     public function addUserQuizQuestion(UserQuizQuestion $userQuizQuestion): self
  854.     {
  855.         if (!$this->userQuizQuestions->contains($userQuizQuestion)) {
  856.             $this->userQuizQuestions[] = $userQuizQuestion;
  857.             $userQuizQuestion->setModule($this);
  858.         }
  859.         return $this;
  860.     }
  861.     public function removeUserQuizQuestion(UserQuizQuestion $userQuizQuestion): self
  862.     {
  863.         if ($this->userQuizQuestions->removeElement($userQuizQuestion)) {
  864.             // set the owning side to null (unless already changed)
  865.             if ($userQuizQuestion->getModule() === $this) {
  866.                 $userQuizQuestion->setModule(null);
  867.             }
  868.         }
  869.         return $this;
  870.     }
  871.     public function getPartenaire(): ?Partenaire
  872.     {
  873.         return $this->partenaire;
  874.     }
  875.     public function setPartenaire(?Partenaire $partenaire): self
  876.     {
  877.         $this->partenaire $partenaire;
  878.         return $this;
  879.     }
  880.     public function isIsAuthoredByCofina(): ?bool
  881.     {
  882.         return $this->isAuthoredByCofina;
  883.     }
  884.     public function setIsAuthoredByCofina(?bool $isAuthoredByCofina): self
  885.     {
  886.         $this->isAuthoredByCofina $isAuthoredByCofina;
  887.         return $this;
  888.     }
  889.     /**
  890.      * @return Collection<int, Notification>
  891.      */
  892.     public function getNotifications(): Collection
  893.     {
  894.         return $this->notifications;
  895.     }
  896.     public function addNotification(Notification $notification): self
  897.     {
  898.         if (!$this->notifications->contains($notification)) {
  899.             $this->notifications[] = $notification;
  900.             $notification->setModule($this);
  901.         }
  902.         return $this;
  903.     }
  904.     public function removeNotification(Notification $notification): self
  905.     {
  906.         if ($this->notifications->removeElement($notification)) {
  907.             // set the owning side to null (unless already changed)
  908.             if ($notification->getModule() === $this) {
  909.                 $notification->setModule(null);
  910.             }
  911.         }
  912.         return $this;
  913.     }
  914.     /**
  915.      * @return Collection<int, Job>
  916.      */
  917.     public function getJobs(): Collection
  918.     {
  919.         return $this->jobs;
  920.     }
  921.     public function addJob(Job $job): self
  922.     {
  923.         if (!$this->jobs->contains($job)) {
  924.             $this->jobs[] = $job;
  925.         }
  926.         return $this;
  927.     }
  928.     public function removeJob(Job $job): self
  929.     {
  930.         $this->jobs->removeElement($job);
  931.         return $this;
  932.     }
  933.     /**
  934.      * @return Collection<int, ModuleObjectives>
  935.      */
  936.     public function getModuleObjectives(): Collection
  937.     {
  938.         return $this->moduleObjectives;
  939.     }
  940.     public function addModuleObjective(ModuleObjective $moduleObjective): self
  941.     {
  942.         if (!$this->moduleObjectives->contains($moduleObjective)) {
  943.             $this->moduleObjectives[] = $moduleObjective;
  944.             $moduleObjective->setModule($this);
  945.         }
  946.         return $this;
  947.     }
  948.     public function removeModuleObjective(ModuleObjective $moduleObjective): self
  949.     {
  950.         if ($this->moduleObjectives->removeElement($moduleObjective)) {
  951.             // set the owning side to null (unless already changed)
  952.             if ($moduleObjective->getModule() === $this) {
  953.                 $moduleObjective->setModule(null);
  954.             }
  955.         }
  956.         return $this;
  957.     }
  958. }