<?php
namespace App\Entity;
use App\Repository\SeanceRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: SeanceRepository::class)]
class Seance
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $titre = null;
#[ORM\Column(type: Types::SMALLINT, nullable: true)]
private ?int $duree = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $objectifIntermediaire = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $prerequis = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $deroule = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $ressourcesFournies = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $remarque = null;
#[ORM\ManyToOne(inversedBy: 'refSeances')]
#[ORM\JoinColumn(nullable: false)]
private ?Sequence $refSequence = null;
#[ORM\ManyToMany(targetEntity: Competence::class)]
private Collection $refCompetences;
#[ORM\ManyToMany(targetEntity: SavoirTechnologique::class)]
private Collection $refSavoirTechnologique;
#[ORM\OneToMany(mappedBy: 'refSeance', targetEntity: SeanceDetail::class, orphanRemoval: true)]
#[ORM\OrderBy(["phase" => "ASC"])]
private Collection $refSeancesDetails;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $organisation = null;
#[ORM\ManyToOne(inversedBy: 'refSeances')]
private ?ThemeSeance $refThemeSeance = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $etape = null;
#[ORM\Column(nullable: true)]
private ?int $bloom = null;
public function __construct()
{
$this->refCompetences = new ArrayCollection();
$this->refSavoirTechnologique = new ArrayCollection();
$this->refSeancesDetails = 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 getDuree(): ?int
{
return $this->duree;
}
public function setDuree(?int $duree): self
{
$this->duree = $duree;
return $this;
}
public function getObjectifIntermediaire(): ?string
{
return $this->objectifIntermediaire;
}
public function setObjectifIntermediaire(?string $objectifIntermediaire): self
{
$this->objectifIntermediaire = $objectifIntermediaire;
return $this;
}
public function getPrerequis(): ?string
{
return $this->prerequis;
}
public function setPrerequis(?string $prerequis): self
{
$this->prerequis = $prerequis;
return $this;
}
public function getDeroule(): ?string
{
return $this->deroule;
}
public function setDeroule(?string $deroule): self
{
$this->deroule = $deroule;
return $this;
}
public function getRessourcesFournies(): ?string
{
return $this->ressourcesFournies;
}
public function setRessourcesFournies(?string $ressourcesFournies): self
{
$this->ressourcesFournies = $ressourcesFournies;
return $this;
}
public function getRemarque(): ?string
{
return $this->remarque;
}
public function setRemarque(?string $remarque): self
{
$this->remarque = $remarque;
return $this;
}
public function getRefSequence(): ?Sequence
{
return $this->refSequence;
}
public function setRefSequence(?Sequence $refSequence): self
{
$this->refSequence = $refSequence;
return $this;
}
/**
* @return Collection<int, Competence>
*/
public function getRefCompetences(): Collection
{
return $this->refCompetences;
}
public function addRefCompetence(Competence $refCompetence): self
{
if (!$this->refCompetences->contains($refCompetence)) {
$this->refCompetences->add($refCompetence);
}
return $this;
}
public function removeRefCompetence(Competence $refCompetence): self
{
$this->refCompetences->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 __toString(): string
{
return $this->getTitre();
// TODO: Implement __toString() method.
}
/**
* @return Collection<int, SeanceDetail>
*/
public function getRefSeancesDetails(): Collection
{
return $this->refSeancesDetails;
}
public function addRefSeancesDetail(SeanceDetail $refSeancesDetail): self
{
if (!$this->refSeancesDetails->contains($refSeancesDetail)) {
$this->refSeancesDetails->add($refSeancesDetail);
$refSeancesDetail->setRefSeance($this);
}
return $this;
}
public function removeRefSeancesDetail(SeanceDetail $refSeancesDetail): self
{
if ($this->refSeancesDetails->removeElement($refSeancesDetail)) {
// set the owning side to null (unless already changed)
if ($refSeancesDetail->getRefSeance() === $this) {
$refSeancesDetail->setRefSeance(null);
}
}
return $this;
}
public function getPositionSeance() :?int {
return $this->getRefSequence()->getRefSeances()->indexOf($this)+1;
}
public function getOrganisation(): ?string
{
return $this->organisation;
}
public function setOrganisation(?string $organisation): self
{
$this->organisation = $organisation;
return $this;
}
public function getRefThemeSeance(): ?ThemeSeance
{
return $this->refThemeSeance;
}
public function setRefThemeSeance(?ThemeSeance $refThemeSeance): self
{
$this->refThemeSeance = $refThemeSeance;
return $this;
}
public function getEtape(): ?string
{
return $this->etape;
}
public function setEtape(?string $etape): self
{
$this->etape = $etape;
return $this;
}
public function getBloom(): ?int
{
return $this->bloom;
}
public function setBloom(?int $bloom): self
{
$this->bloom = $bloom;
return $this;
}
}