src/Entity/Sequence.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\SequenceRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassSequenceRepository::class)]
  9. class Sequence
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $titre null;
  17.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  18.     private ?string $Objectif null;
  19.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  20.     private ?string $Attendu null;
  21.     #[ORM\OneToMany(mappedBy'refSequence'targetEntitySeance::class)]
  22.     #[ORM\OrderBy(["titre" => "ASC"])]
  23.     private Collection $refSeances;
  24.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  25.     private ?string $prerequis null;
  26.     #[ORM\ManyToOne(inversedBy'refSequences')]
  27.     #[ORM\JoinColumn(nullablefalse)]
  28.     private ?Filiere $refFiliere null;
  29.     #[ORM\ManyToMany(targetEntityCompetence::class, inversedBy'refSequences')]
  30.     private Collection $refCompetence;
  31.     #[ORM\ManyToMany(targetEntitySavoirTechnologique::class, inversedBy'refSequences')]
  32.     private Collection $refSavoirTechnologique;
  33.     #[ORM\Column(length255nullabletrue)]
  34.     private ?string $periode null;
  35.     #[ORM\ManyToOne(inversedBy'refSequences')]
  36.     private ?ThemeSequence $refThemeSequence null;
  37.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  38.     private ?string $bilan null;
  39.     public function __construct()
  40.     {
  41.         $this->refSeances = new ArrayCollection();
  42.         $this->refCompetence = new ArrayCollection();
  43.         $this->refSavoirTechnologique = new ArrayCollection();
  44.     }
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getTitre(): ?string
  50.     {
  51.         return $this->titre;
  52.     }
  53.     public function setTitre(string $titre): self
  54.     {
  55.         $this->titre $titre;
  56.         return $this;
  57.     }
  58.     public function getObjectif(): ?string
  59.     {
  60.         return $this->Objectif;
  61.     }
  62.     public function setObjectif(?string $Objectif): self
  63.     {
  64.         $this->Objectif $Objectif;
  65.         return $this;
  66.     }
  67.     public function getAttendu(): ?string
  68.     {
  69.         return $this->Attendu;
  70.     }
  71.     public function setAttendu(?string $Attendu): self
  72.     {
  73.         $this->Attendu $Attendu;
  74.         return $this;
  75.     }
  76.     /**
  77.      * @return Collection<int, Seance>
  78.      */
  79.     public function getRefSeances(): Collection
  80.     {
  81.         return $this->refSeances;
  82.     }
  83.     public function addRefSeance(Seance $refSeance): self
  84.     {
  85.         if (!$this->refSeances->contains($refSeance)) {
  86.             $this->refSeances->add($refSeance);
  87.             $refSeance->setRefSequence($this);
  88.         }
  89.         return $this;
  90.     }
  91.     public function removeRefSeance(Seance $refSeance): self
  92.     {
  93.         if ($this->refSeances->removeElement($refSeance)) {
  94.             // set the owning side to null (unless already changed)
  95.             if ($refSeance->getRefSequence() === $this) {
  96.                 $refSeance->setRefSequence(null);
  97.             }
  98.         }
  99.         return $this;
  100.     }
  101.     public function __toString(): string
  102.     {
  103.         return $this->getTitre();
  104.         // TODO: Implement __toString() method.
  105.     }
  106.     public function getMainCompetences(): Collection{
  107.          $mainCompetences = new ArrayCollection();
  108.          foreach ($this->getRefCompetence() as $competence){
  109.              $mainCompetence $competence->getMainCompetence();
  110.              if (!$mainCompetences->contains($mainCompetence))
  111.                  $mainCompetences->add($mainCompetence);
  112.          }
  113.          return $mainCompetences;
  114.     }
  115.     public function getPrerequis(): ?string
  116.     {
  117.         return $this->prerequis;
  118.     }
  119.     public function setPrerequis(?string $prerequis): self
  120.     {
  121.         $this->prerequis $prerequis;
  122.         return $this;
  123.     }
  124.     public function getRefFiliere(): ?Filiere
  125.     {
  126.         return $this->refFiliere;
  127.     }
  128.     public function setRefFiliere(?Filiere $refFiliere): self
  129.     {
  130.         $this->refFiliere $refFiliere;
  131.         return $this;
  132.     }
  133.     /**
  134.      * @return Collection<int, Competence>
  135.      */
  136.     public function getRefCompetence(): Collection
  137.     {
  138.         return $this->refCompetence;
  139.     }
  140.     public function addRefCompetence(Competence $refCompetence): self
  141.     {
  142.         if (!$this->refCompetence->contains($refCompetence)) {
  143.             $this->refCompetence->add($refCompetence);
  144.         }
  145.         return $this;
  146.     }
  147.     public function removeRefCompetence(Competence $refCompetence): self
  148.     {
  149.         $this->refCompetence->removeElement($refCompetence);
  150.         return $this;
  151.     }
  152.     /**
  153.      * @return Collection<int, SavoirTechnologique>
  154.      */
  155.     public function getRefSavoirTechnologique(): Collection
  156.     {
  157.         return $this->refSavoirTechnologique;
  158.     }
  159.     public function addRefSavoirTechnologique(SavoirTechnologique $refSavoirTechnologique): self
  160.     {
  161.         if (!$this->refSavoirTechnologique->contains($refSavoirTechnologique)) {
  162.             $this->refSavoirTechnologique->add($refSavoirTechnologique);
  163.         }
  164.         return $this;
  165.     }
  166.     public function removeRefSavoirTechnologique(SavoirTechnologique $refSavoirTechnologique): self
  167.     {
  168.         $this->refSavoirTechnologique->removeElement($refSavoirTechnologique);
  169.         return $this;
  170.     }
  171.     public function getPeriode(): ?string
  172.     {
  173.         return $this->periode;
  174.     }
  175.     public function setPeriode(?string $periode): self
  176.     {
  177.         $this->periode $periode;
  178.         return $this;
  179.     }
  180.     public function getRefThemeSequence(): ?ThemeSequence
  181.     {
  182.         return $this->refThemeSequence;
  183.     }
  184.     public function setRefThemeSequence(?ThemeSequence $refThemeSequence): self
  185.     {
  186.         $this->refThemeSequence $refThemeSequence;
  187.         return $this;
  188.     }
  189.     public function getBilan(): ?string
  190.     {
  191.         return $this->bilan;
  192.     }
  193.     public function setBilan(?string $bilan): self
  194.     {
  195.         $this->bilan $bilan;
  196.         return $this;
  197.     }
  198. }