src/Entity/Gestiform/Formations/Catalogue/Module/ModuleCompetence.php line 20

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gestiform\Formations\Catalogue\Module;
  3. use App\Entity\AbstractEntity;
  4. use App\Entity\Common\Document;
  5. use App\Entity\Gestiform\Admin\MasterListe\Masterlistelg;
  6. use App\Entity\Gestiform\Formations\Catalogue\Competence;
  7. use App\Entity\Gestiform\Quiz\Quiz;
  8. use App\Repository\Gestiform\Formations\Catalogue\Module\ModuleCompetenceRepository;
  9. use App\Trait\SortableEntity;
  10. use Doctrine\Common\Collections\ArrayCollection;
  11. use Doctrine\Common\Collections\Collection;
  12. use Doctrine\ORM\Mapping as ORM;
  13. use Gedmo\Mapping\Annotation as Gedmo;
  14. /**
  15.  * @ORM\Entity(repositoryClass=ModuleCompetenceRepository::class)
  16.  */
  17. class ModuleCompetence extends AbstractEntity
  18. {
  19.     use SortableEntity;
  20.     /**
  21.      * @ORM\ManyToOne(targetEntity=Competence::class, inversedBy="moduleCompetences")
  22.      * @ORM\JoinColumn(nullable=false)
  23.      */
  24.     private Competence $competence;
  25.     /**
  26.      * @Gedmo\SortableGroup()
  27.      * @ORM\ManyToOne(targetEntity=Module::class, inversedBy="moduleCompetences",cascade={"persist"})
  28.      * @ORM\JoinColumn(nullable=false)
  29.      */
  30.     private Module $module;
  31.     /**
  32.      * @ORM\Column(type="text", length=255, nullable=true)
  33.      */
  34.     private ?string $modaliteEvaluations null;
  35.     /**
  36.      * @ORM\Column(type="integer", nullable=true)
  37.      */
  38.     private ?int $duree null;
  39.     /**
  40.      * @ORM\ManyToMany(targetEntity=Masterlistelg::class, cascade={"persist"})
  41.      * @ORM\JoinTable(name="module_competence_procede_evaluations",
  42.      *      joinColumns={@ORM\JoinColumn(name="module_competence_competence_id", referencedColumnName="id")},
  43.      *      inverseJoinColumns={@ORM\JoinColumn(name="masterlistelg_id", referencedColumnName="id")}
  44.      * )
  45.      */
  46.     private Collection $procedeEvaluations;
  47.     /**
  48.      * @ORM\OneToMany(targetEntity=Document::class, mappedBy="moduleCompetence",cascade={"persist"})
  49.      */
  50.     private Collection $documents;
  51.     /**
  52.      * @ORM\ManyToOne(targetEntity=Quiz::class,cascade={"persist"})
  53.      * @ORM\JoinColumn(nullable=true)
  54.      */
  55.     private ?Quiz $quiz=null;
  56.     public function __construct()
  57.     {
  58.         $this->procedeEvaluations = new ArrayCollection();
  59.         $this->documents = new ArrayCollection();
  60.     }
  61.     public function getCompetence(): ?Competence
  62.     {
  63.         return $this->competence;
  64.     }
  65.     public function setCompetence(?Competence $competence): self
  66.     {
  67.         $this->competence $competence;
  68.         return $this;
  69.     }
  70.     public function getModule(): ?Module
  71.     {
  72.         return $this->module;
  73.     }
  74.     public function setModule(?Module $module): self
  75.     {
  76.         $this->module $module;
  77.         return $this;
  78.     }
  79.     public function getModaliteEvaluations(): ?string
  80.     {
  81.         return $this->modaliteEvaluations;
  82.     }
  83.     public function setModaliteEvaluations(?string $modaliteEvaluations): self
  84.     {
  85.         $this->modaliteEvaluations $modaliteEvaluations;
  86.         return $this;
  87.     }
  88.     public function getDuree(): ?int
  89.     {
  90.         return $this->duree;
  91.     }
  92.     public function setDuree(?int $duree): self
  93.     {
  94.         $this->duree $duree;
  95.         return $this;
  96.     }
  97.     /**
  98.      * @return Collection<int, Masterlistelg>
  99.      */
  100.     public function getProcedeEvaluations(): Collection
  101.     {
  102.         return $this->procedeEvaluations;
  103.     }
  104.     public function addProcedeEvaluation(Masterlistelg $procedeEvaluation): self
  105.     {
  106.         if (!$this->procedeEvaluations->contains($procedeEvaluation)) {
  107.             $this->procedeEvaluations->add($procedeEvaluation);
  108.         }
  109.         return $this;
  110.     }
  111.     public function removeProcedeEvaluation(Masterlistelg $procedeEvaluation): self
  112.     {
  113.         $this->procedeEvaluations->removeElement($procedeEvaluation);
  114.         return $this;
  115.     }
  116.     
  117.     /**
  118.      * @return Collection<int, Document>
  119.      */
  120.     public function getDocuments(): Collection
  121.     {
  122.         return $this->documents;
  123.     }
  124.     public function addDocument(Document $document): self
  125.     {
  126.         if (!$this->documents->contains($document)) {
  127.             $this->documents->add($document);
  128.             $document->setModuleCompetence($this);
  129.         }
  130.         return $this;
  131.     }
  132.     public function removeDocument(Document $document): self
  133.     {
  134.         if ($this->documents->removeElement($document)) {
  135.             // set the owning side to null (unless already changed)
  136.             if ($document->getModuleCompetence() === $this) {
  137.                 $document->setModuleCompetence(null);
  138.             }
  139.         }
  140.         return $this;
  141.     }
  142.     public function getQuiz(): ?Quiz
  143.     {
  144.         return $this->quiz;
  145.     }
  146.     public function setQuiz(?Quiz $quiz): self
  147.     {
  148.         $this->quiz $quiz;
  149.         return $this;
  150.     }
  151. }