<?php
namespace App\Entity;
use App\Repository\SequenceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: SequenceRepository::class)]
class Sequence
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $titre = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $Objectif = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $Attendu = null;
#[ORM\OneToMany(mappedBy: 'refSequence', targetEntity: Seance::class)]
#[ORM\OrderBy(["titre" => "ASC"])]
private Collection $refSeances;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $prerequis = null;
#[ORM\ManyToOne(inversedBy: 'refSequences')]
#[ORM\JoinColumn(nullable: false)]
private ?Filiere $refFiliere = null;
#[ORM\ManyToMany(targetEntity: Competence::class, inversedBy: 'refSequences')]
private Collection $refCompetence;
#[ORM\ManyToMany(targetEntity: SavoirTechnologique::class, inversedBy: 'refSequences')]
private Collection $refSavoirTechnologique;
#[ORM\Column(length: 255, nullable: true)]
private ?string $periode = null;
#[ORM\ManyToOne(inversedBy: 'refSequences')]
private ?ThemeSequence $refThemeSequence = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $bilan = null;
public function __construct()
{
$this->refSeances = new ArrayCollection();
$this->refCompetence = new ArrayCollection();
$this->refSavoirTechnologique = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getTitre(): ?string
{
return $this->titre;
}
public function setTitre(string $titre): self
{
$this->titre = $titre;
return $this;
}
public function getObjectif(): ?string
{
return $this->Objectif;
}
public function setObjectif(?string $Objectif): self
{
$this->Objectif = $Objectif;
return $this;
}
public function getAttendu(): ?string
{
return $this->Attendu;
}
public function setAttendu(?string $Attendu): self
{
$this->Attendu = $Attendu;
return $this;
}
/**
* @return Collection<int, Seance>
*/
public function getRefSeances(): Collection
{
return $this->refSeances;
}
public function addRefSeance(Seance $refSeance): self
{
if (!$this->refSeances->contains($refSeance)) {
$this->refSeances->add($refSeance);
$refSeance->setRefSequence($this);
}
return $this;
}
public function removeRefSeance(Seance $refSeance): self
{
if ($this->refSeances->removeElement($refSeance)) {
// set the owning side to null (unless already changed)
if ($refSeance->getRefSequence() === $this) {
$refSeance->setRefSequence(null);
}
}
return $this;
}
public function __toString(): string
{
return $this->getTitre();
// TODO: Implement __toString() method.
}
public function getMainCompetences(): Collection{
$mainCompetences = new ArrayCollection();
foreach ($this->getRefCompetence() as $competence){
$mainCompetence = $competence->getMainCompetence();
if (!$mainCompetences->contains($mainCompetence))
$mainCompetences->add($mainCompetence);
}
return $mainCompetences;
}
public function getPrerequis(): ?string
{
return $this->prerequis;
}
public function setPrerequis(?string $prerequis): self
{
$this->prerequis = $prerequis;
return $this;
}
public function getRefFiliere(): ?Filiere
{
return $this->refFiliere;
}
public function setRefFiliere(?Filiere $refFiliere): self
{
$this->refFiliere = $refFiliere;
return $this;
}
/**
* @return Collection<int, Competence>
*/
public function getRefCompetence(): Collection
{
return $this->refCompetence;
}
public function addRefCompetence(Competence $refCompetence): self
{
if (!$this->refCompetence->contains($refCompetence)) {
$this->refCompetence->add($refCompetence);
}
return $this;
}
public function removeRefCompetence(Competence $refCompetence): self
{
$this->refCompetence->removeElement($refCompetence);
return $this;
}
/**
* @return Collection<int, SavoirTechnologique>
*/
public function getRefSavoirTechnologique(): Collection
{
return $this->refSavoirTechnologique;
}
public function addRefSavoirTechnologique(SavoirTechnologique $refSavoirTechnologique): self
{
if (!$this->refSavoirTechnologique->contains($refSavoirTechnologique)) {
$this->refSavoirTechnologique->add($refSavoirTechnologique);
}
return $this;
}
public function removeRefSavoirTechnologique(SavoirTechnologique $refSavoirTechnologique): self
{
$this->refSavoirTechnologique->removeElement($refSavoirTechnologique);
return $this;
}
public function getPeriode(): ?string
{
return $this->periode;
}
public function setPeriode(?string $periode): self
{
$this->periode = $periode;
return $this;
}
public function getRefThemeSequence(): ?ThemeSequence
{
return $this->refThemeSequence;
}
public function setRefThemeSequence(?ThemeSequence $refThemeSequence): self
{
$this->refThemeSequence = $refThemeSequence;
return $this;
}
public function getBilan(): ?string
{
return $this->bilan;
}
public function setBilan(?string $bilan): self
{
$this->bilan = $bilan;
return $this;
}
}