<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\FormationElearningRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Types\Types;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity(repositoryClass: FormationElearningRepository::class)]
#[ApiResource]
class FormationElearning
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $titre = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $description = null;
#[ORM\Column(type: Types::TEXT, nullable: true)]
private ?string $programme = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $affiche = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $prix = null;
#[ORM\Column(nullable: true)]
private ?bool $isPromo = null;
#[ORM\Column(length: 255, nullable: true)]
private ?string $prixPromo = null;
#[ORM\ManyToOne(inversedBy: 'formationElearnings')]
private ?CategorieElearning $categorie = null;
#[ORM\ManyToOne(inversedBy: 'formationElearnings')]
private ?User $formateur = null;
#[ORM\OneToMany(mappedBy: 'formation', targetEntity: VideoElearning::class,cascade: ['remove'])]
private Collection $videoElearnings;
#[ORM\Column(length: 255, nullable: true)]
private ?string $slug = null;
#[ORM\OneToMany(mappedBy: 'formation', targetEntity: CommandeFormation::class,cascade: ['remove'])]
private Collection $commandeFormations;
#[ORM\Column(length: 255, nullable: true)]
private ?string $video = null;
#[ORM\OneToMany(mappedBy: 'formation', targetEntity: SectionElearning::class,cascade: ['remove'])]
private Collection $sectionElearnings;
#[ORM\OneToMany(mappedBy: 'formation', targetEntity: TemoignageElearning::class,cascade: ['remove'])]
private Collection $temoignageElearnings;
#[ORM\OneToMany(mappedBy: 'formation', targetEntity: CertifElearning::class,cascade: ['remove'])]
private Collection $certifElearnings;
#[ORM\OneToMany(mappedBy: 'formation', targetEntity: EvaluationElearning::class,cascade: ['remove'])]
private Collection $evaluationElearnings;
#[ORM\OneToMany(mappedBy: 'formation', targetEntity: PackItem::class)]
private Collection $packItems;
#[ORM\OneToMany(mappedBy: 'formation', targetEntity: ChatFormation::class)]
private Collection $chatFormations;
public function __construct()
{
$this->videoElearnings = new ArrayCollection();
$this->commandeFormations = new ArrayCollection();
$this->sectionElearnings = new ArrayCollection();
$this->temoignageElearnings = new ArrayCollection();
$this->certifElearnings = new ArrayCollection();
$this->evaluationElearnings = new ArrayCollection();
$this->packItems = new ArrayCollection();
$this->chatFormations = 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 getDescription(): ?string
{
return $this->description;
}
public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}
public function getProgramme(): ?string
{
return $this->programme;
}
public function setProgramme(?string $programme): self
{
$this->programme = $programme;
return $this;
}
public function getAffiche(): ?string
{
return $this->affiche;
}
public function setAffiche(?string $affiche): self
{
$this->affiche = $affiche;
return $this;
}
public function getPrix(): ?string
{
return $this->prix;
}
public function setPrix(?string $prix): self
{
$this->prix = $prix;
return $this;
}
public function isIsPromo(): ?bool
{
return $this->isPromo;
}
public function setIsPromo(?bool $isPromo): self
{
$this->isPromo = $isPromo;
return $this;
}
public function getPrixPromo(): ?string
{
return $this->prixPromo;
}
public function setPrixPromo(?string $prixPromo): self
{
$this->prixPromo = $prixPromo;
return $this;
}
public function getCategorie(): ?CategorieElearning
{
return $this->categorie;
}
public function setCategorie(?CategorieElearning $categorie): self
{
$this->categorie = $categorie;
return $this;
}
public function getFormateur(): ?User
{
return $this->formateur;
}
public function setFormateur(?User $formateur): self
{
$this->formateur = $formateur;
return $this;
}
/**
* @return Collection<int, VideoElearning>
*/
public function getVideoElearnings(): Collection
{
return $this->videoElearnings;
}
public function addVideoElearning(VideoElearning $videoElearning): self
{
if (!$this->videoElearnings->contains($videoElearning)) {
$this->videoElearnings->add($videoElearning);
$videoElearning->setFormation($this);
}
return $this;
}
public function removeVideoElearning(VideoElearning $videoElearning): self
{
if ($this->videoElearnings->removeElement($videoElearning)) {
// set the owning side to null (unless already changed)
if ($videoElearning->getFormation() === $this) {
$videoElearning->setFormation(null);
}
}
return $this;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(?string $slug): self
{
$this->slug = $slug;
return $this;
}
/**
* @return Collection<int, CommandeFormation>
*/
public function getCommandeFormations(): Collection
{
return $this->commandeFormations;
}
public function addCommandeFormation(CommandeFormation $commandeFormation): self
{
if (!$this->commandeFormations->contains($commandeFormation)) {
$this->commandeFormations->add($commandeFormation);
$commandeFormation->setFormation($this);
}
return $this;
}
public function removeCommandeFormation(CommandeFormation $commandeFormation): self
{
if ($this->commandeFormations->removeElement($commandeFormation)) {
// set the owning side to null (unless already changed)
if ($commandeFormation->getFormation() === $this) {
$commandeFormation->setFormation(null);
}
}
return $this;
}
public function getVideo(): ?string
{
return $this->video;
}
public function setVideo(?string $video): self
{
$this->video = $video;
return $this;
}
/**
* @return Collection<int, SectionElearning>
*/
public function getSectionElearnings(): Collection
{
return $this->sectionElearnings;
}
public function addSectionElearning(SectionElearning $sectionElearning): self
{
if (!$this->sectionElearnings->contains($sectionElearning)) {
$this->sectionElearnings->add($sectionElearning);
$sectionElearning->setFormation($this);
}
return $this;
}
public function removeSectionElearning(SectionElearning $sectionElearning): self
{
if ($this->sectionElearnings->removeElement($sectionElearning)) {
// set the owning side to null (unless already changed)
if ($sectionElearning->getFormation() === $this) {
$sectionElearning->setFormation(null);
}
}
return $this;
}
/**
* @return Collection<int, TemoignageElearning>
*/
public function getTemoignageElearnings(): Collection
{
return $this->temoignageElearnings;
}
public function addTemoignageElearning(TemoignageElearning $temoignageElearning): self
{
if (!$this->temoignageElearnings->contains($temoignageElearning)) {
$this->temoignageElearnings->add($temoignageElearning);
$temoignageElearning->setFormation($this);
}
return $this;
}
public function removeTemoignageElearning(TemoignageElearning $temoignageElearning): self
{
if ($this->temoignageElearnings->removeElement($temoignageElearning)) {
// set the owning side to null (unless already changed)
if ($temoignageElearning->getFormation() === $this) {
$temoignageElearning->setFormation(null);
}
}
return $this;
}
/**
* @return Collection<int, CertifElearning>
*/
public function getCertifElearnings(): Collection
{
return $this->certifElearnings;
}
public function addCertifElearning(CertifElearning $certifElearning): self
{
if (!$this->certifElearnings->contains($certifElearning)) {
$this->certifElearnings->add($certifElearning);
$certifElearning->setFormation($this);
}
return $this;
}
public function removeCertifElearning(CertifElearning $certifElearning): self
{
if ($this->certifElearnings->removeElement($certifElearning)) {
// set the owning side to null (unless already changed)
if ($certifElearning->getFormation() === $this) {
$certifElearning->setFormation(null);
}
}
return $this;
}
/**
* @return Collection<int, EvaluationElearning>
*/
public function getEvaluationElearnings(): Collection
{
return $this->evaluationElearnings;
}
public function addEvaluationElearning(EvaluationElearning $evaluationElearning): self
{
if (!$this->evaluationElearnings->contains($evaluationElearning)) {
$this->evaluationElearnings->add($evaluationElearning);
$evaluationElearning->setFormation($this);
}
return $this;
}
public function removeEvaluationElearning(EvaluationElearning $evaluationElearning): self
{
if ($this->evaluationElearnings->removeElement($evaluationElearning)) {
// set the owning side to null (unless already changed)
if ($evaluationElearning->getFormation() === $this) {
$evaluationElearning->setFormation(null);
}
}
return $this;
}
/**
* @return Collection<int, PackItem>
*/
public function getPackItems(): Collection
{
return $this->packItems;
}
public function addPackItem(PackItem $packItem): self
{
if (!$this->packItems->contains($packItem)) {
$this->packItems->add($packItem);
$packItem->setFormation($this);
}
return $this;
}
public function removePackItem(PackItem $packItem): self
{
if ($this->packItems->removeElement($packItem)) {
// set the owning side to null (unless already changed)
if ($packItem->getFormation() === $this) {
$packItem->setFormation(null);
}
}
return $this;
}
/**
* @return Collection<int, ChatFormation>
*/
public function getChatFormations(): Collection
{
return $this->chatFormations;
}
public function addChatFormation(ChatFormation $chatFormation): self
{
if (!$this->chatFormations->contains($chatFormation)) {
$this->chatFormations->add($chatFormation);
$chatFormation->setFormation($this);
}
return $this;
}
public function removeChatFormation(ChatFormation $chatFormation): self
{
if ($this->chatFormations->removeElement($chatFormation)) {
// set the owning side to null (unless already changed)
if ($chatFormation->getFormation() === $this) {
$chatFormation->setFormation(null);
}
}
return $this;
}
}