src/Entity/Formation.php line 17

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\FormationRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. use Symfony\Component\Serializer\Annotation\Groups;
  10. #[ORM\Entity(repositoryClassFormationRepository::class)]
  11. #[ApiResource(normalizationContext: ['groups' => ['Formation_read']])]
  12. class Formation
  13. {
  14.     #[ORM\Id]
  15.     #[ORM\GeneratedValue]
  16.     #[ORM\Column]
  17.     #[Groups(['Formation_read'])]
  18.     private ?int $id null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     #[Groups(['Formation_read'])]
  21.     private ?string $titre null;
  22.     #[ORM\Column(length255nullabletrue)]
  23.     #[Groups(['Formation_read'])]
  24.     private ?string $prix null;
  25.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  26.     #[Groups(['Formation_read'])]
  27.     private ?string $description null;
  28.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  29.     #[Groups(['Formation_read'])]
  30.     private ?string $contenu null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     #[Groups(['Formation_read'])]
  33.     private ?string $affiche null;
  34.     #[ORM\Column(length255nullabletrue)]
  35.     #[Groups(['Formation_read'])]
  36.     private ?string $duree null;
  37.     #[ORM\Column(length255)]
  38.     #[Groups(['Formation_read'])]
  39.     private ?string $slug null;
  40.     #[ORM\ManyToOne(inversedBy'relation')]
  41.     #[Groups(['Formation_read'])]
  42.     private ?Planification $planification null;
  43.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  44.     #[Groups(['Formation_read'])]
  45.     private ?string $texttt null;
  46.     #[ORM\Column(length255nullabletrue)]
  47.     #[Groups(['Formation_read'])]
  48.     private ?string $totalinscrit null;
  49.     #[ORM\Column(length255nullabletrue)]
  50.     #[Groups(['Formation_read'])]
  51.     private ?string $nblike null;
  52.     #[ORM\Column(length255nullabletrue)]
  53.     #[Groups(['Formation_read'])]
  54.     private ?string $nbavis null;
  55.     #[ORM\Column(length255nullabletrue)]
  56.     #[Groups(['Formation_read'])]
  57.     private ?string $niveau null;
  58.     #[ORM\Column(length255nullabletrue)]
  59.     #[Groups(['Formation_read'])]
  60.     private ?string $categorie null;
  61.     #[ORM\Column(length255nullabletrue)]
  62.     #[Groups(['Formation_read'])]
  63.     private ?string $nbheure null;
  64.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  65.     #[Groups(['Formation_read'])]
  66.     private ?string $desccourt null;
  67.     #[ORM\Column(length255nullabletrue)]
  68.     #[Groups(['Formation_read'])]
  69.     private ?string $photofront null;
  70.     #[ORM\ManyToOne(inversedBy'formations')]
  71.     private ?User $formateur null;
  72.     #[ORM\OneToMany(mappedBy'formation'targetEntitySection::class,cascade: ['remove'])]
  73.     #[Groups(['Formation_read'])] // ðŸ‘ˆ ajouter ceci
  74.     private Collection $sections;
  75.     #[ORM\OneToMany(mappedBy'formation'targetEntityEvenement::class,cascade: ['remove'])]
  76.     private Collection $evenements;
  77.     #[ORM\Column(nullabletrue)]
  78.     #[Groups(['Formation_read'])]
  79.     private ?bool $isPopulaire null;
  80.     #[ORM\ManyToMany(targetEntityOffres::class, mappedBy'formation')]
  81.     private Collection $offres;
  82.     #[ORM\OneToMany(mappedBy'formation'targetEntityTrace::class,cascade: ['remove'])]
  83.     private Collection $traces;
  84.     public function __construct()
  85.     {
  86.         $this->sections = new ArrayCollection();
  87.         $this->evenements = new ArrayCollection();
  88.         $this->offres = new ArrayCollection();
  89.         $this->traces = new ArrayCollection();
  90.     }
  91.     public function getId(): ?int
  92.     {
  93.         return $this->id;
  94.     }
  95.     public function getTitre(): ?string
  96.     {
  97.         return $this->titre;
  98.     }
  99.     public function setTitre(?string $titre): self
  100.     {
  101.         $this->titre $titre;
  102.         return $this;
  103.     }
  104.     public function getPrix(): ?string
  105.     {
  106.         return $this->prix;
  107.     }
  108.     public function setPrix(?string $prix): self
  109.     {
  110.         $this->prix $prix;
  111.         return $this;
  112.     }
  113.     public function getDescription(): ?string
  114.     {
  115.         return $this->description;
  116.     }
  117.     public function setDescription(?string $description): self
  118.     {
  119.         $this->description $description;
  120.         return $this;
  121.     }
  122.     public function getContenu(): ?string
  123.     {
  124.         return $this->contenu;
  125.     }
  126.     public function setContenu(?string $contenu): self
  127.     {
  128.         $this->contenu $contenu;
  129.         return $this;
  130.     }
  131.     public function getAffiche(): ?string
  132.     {
  133.         return $this->affiche;
  134.     }
  135.     public function setAffiche(?string $affiche): self
  136.     {
  137.         $this->affiche $affiche;
  138.         return $this;
  139.     }
  140.     public function getDuree(): ?string
  141.     {
  142.         return $this->duree;
  143.     }
  144.     public function setDuree(?string $duree): self
  145.     {
  146.         $this->duree $duree;
  147.         return $this;
  148.     }
  149.     public function getSlug(): ?string
  150.     {
  151.         return $this->slug;
  152.     }
  153.     public function setSlug(string $slug): self
  154.     {
  155.         $this->slug $slug;
  156.         return $this;
  157.     }
  158.     public function getPlanification(): ?Planification
  159.     {
  160.         return $this->planification;
  161.     }
  162.     public function setPlanification(?Planification $planification): self
  163.     {
  164.         $this->planification $planification;
  165.         return $this;
  166.     }
  167.     public function getTexttt(): ?string
  168.     {
  169.         return $this->texttt;
  170.     }
  171.     public function setTexttt(?string $texttt): self
  172.     {
  173.         $this->texttt $texttt;
  174.         return $this;
  175.     }
  176.     public function getTotalinscrit(): ?string
  177.     {
  178.         return $this->totalinscrit;
  179.     }
  180.     public function setTotalinscrit(?string $totalinscrit): self
  181.     {
  182.         $this->totalinscrit $totalinscrit;
  183.         return $this;
  184.     }
  185.     public function getNblike(): ?string
  186.     {
  187.         return $this->nblike;
  188.     }
  189.     public function setNblike(?string $nblike): self
  190.     {
  191.         $this->nblike $nblike;
  192.         return $this;
  193.     }
  194.     public function getNbavis(): ?string
  195.     {
  196.         return $this->nbavis;
  197.     }
  198.     public function setNbavis(?string $nbavis): self
  199.     {
  200.         $this->nbavis $nbavis;
  201.         return $this;
  202.     }
  203.     public function getNiveau(): ?string
  204.     {
  205.         return $this->niveau;
  206.     }
  207.     public function setNiveau(?string $niveau): self
  208.     {
  209.         $this->niveau $niveau;
  210.         return $this;
  211.     }
  212.     public function getCategorie(): ?string
  213.     {
  214.         return $this->categorie;
  215.     }
  216.     public function setCategorie(?string $categorie): self
  217.     {
  218.         $this->categorie $categorie;
  219.         return $this;
  220.     }
  221.     public function getNbheure(): ?string
  222.     {
  223.         return $this->nbheure;
  224.     }
  225.     public function setNbheure(?string $nbheure): self
  226.     {
  227.         $this->nbheure $nbheure;
  228.         return $this;
  229.     }
  230.     public function getDesccourt(): ?string
  231.     {
  232.         return $this->desccourt;
  233.     }
  234.     public function setDesccourt(?string $desccourt): self
  235.     {
  236.         $this->desccourt $desccourt;
  237.         return $this;
  238.     }
  239.     public function getPhotofront(): ?string
  240.     {
  241.         return $this->photofront;
  242.     }
  243.     public function setPhotofront(?string $photofront): self
  244.     {
  245.         $this->photofront $photofront;
  246.         return $this;
  247.     }
  248.     public function getFormateur(): ?User
  249.     {
  250.         return $this->formateur;
  251.     }
  252.     public function setFormateur(?User $formateur): self
  253.     {
  254.         $this->formateur $formateur;
  255.         return $this;
  256.     }
  257.     /**
  258.      * @return Collection<int, Section>
  259.      */
  260.     public function getSections(): Collection
  261.     {
  262.         return $this->sections;
  263.     }
  264.     public function addSection(Section $section): self
  265.     {
  266.         if (!$this->sections->contains($section)) {
  267.             $this->sections->add($section);
  268.             $section->setFormation($this);
  269.         }
  270.         return $this;
  271.     }
  272.     public function removeSection(Section $section): self
  273.     {
  274.         if ($this->sections->removeElement($section)) {
  275.             // set the owning side to null (unless already changed)
  276.             if ($section->getFormation() === $this) {
  277.                 $section->setFormation(null);
  278.             }
  279.         }
  280.         return $this;
  281.     }
  282.     /**
  283.      * @return Collection<int, Evenement>
  284.      */
  285.     public function getEvenements(): Collection
  286.     {
  287.         return $this->evenements;
  288.     }
  289.     public function addEvenement(Evenement $evenement): self
  290.     {
  291.         if (!$this->evenements->contains($evenement)) {
  292.             $this->evenements->add($evenement);
  293.             $evenement->setFormation($this);
  294.         }
  295.         return $this;
  296.     }
  297.     public function removeEvenement(Evenement $evenement): self
  298.     {
  299.         if ($this->evenements->removeElement($evenement)) {
  300.             // set the owning side to null (unless already changed)
  301.             if ($evenement->getFormation() === $this) {
  302.                 $evenement->setFormation(null);
  303.             }
  304.         }
  305.         return $this;
  306.     }
  307.     public function __toString(): string
  308.     {
  309.         return $this->titre;
  310.     }
  311.     public function isIsPopulaire(): ?bool
  312.     {
  313.         return $this->isPopulaire;
  314.     }
  315.     public function setIsPopulaire(?bool $isPopulaire): self
  316.     {
  317.         $this->isPopulaire $isPopulaire;
  318.         return $this;
  319.     }
  320.     /**
  321.      * @return Collection<int, Offres>
  322.      */
  323.     public function getOffres(): Collection
  324.     {
  325.         return $this->offres;
  326.     }
  327.     public function addOffre(Offres $offre): self
  328.     {
  329.         if (!$this->offres->contains($offre)) {
  330.             $this->offres->add($offre);
  331.             $offre->addFormation($this);
  332.         }
  333.         return $this;
  334.     }
  335.     public function removeOffre(Offres $offre): self
  336.     {
  337.         if ($this->offres->removeElement($offre)) {
  338.             $offre->removeFormation($this);
  339.         }
  340.         return $this;
  341.     }
  342.     /**
  343.      * @return Collection<int, Trace>
  344.      */
  345.     public function getTraces(): Collection
  346.     {
  347.         return $this->traces;
  348.     }
  349.     public function addTrace(Trace $trace): self
  350.     {
  351.         if (!$this->traces->contains($trace)) {
  352.             $this->traces->add($trace);
  353.             $trace->setFormation($this);
  354.         }
  355.         return $this;
  356.     }
  357.     public function removeTrace(Trace $trace): self
  358.     {
  359.         if ($this->traces->removeElement($trace)) {
  360.             // set the owning side to null (unless already changed)
  361.             if ($trace->getFormation() === $this) {
  362.                 $trace->setFormation(null);
  363.             }
  364.         }
  365.         return $this;
  366.     }
  367. }