src/Entity/Offres.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\OffresRepository;
  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. #[ORM\Entity(repositoryClassOffresRepository::class)]
  10. #[ApiResource]
  11. class Offres
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[ORM\Column(length255nullabletrue)]
  18.     private ?string $titre null;
  19.     #[ORM\Column(length255nullabletrue)]
  20.     private ?string $prix null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     private ?string $option1 null;
  23.     #[ORM\Column(length255nullabletrue)]
  24.     private ?string $option2 null;
  25.     #[ORM\Column(length255nullabletrue)]
  26.     private ?string $option3 null;
  27.     #[ORM\Column(length255nullabletrue)]
  28.     private ?string $option4 null;
  29.     #[ORM\Column(length255nullabletrue)]
  30.     private ?string $option5 null;
  31.     #[ORM\Column(length255nullabletrue)]
  32.     private ?string $duree null;
  33.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  34.     private ?\DateTimeInterface $dateexp null;
  35.     #[ORM\Column(length255nullabletrue)]
  36.     private ?string $affiche null;
  37.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  38.     private ?string $description null;
  39.     #[ORM\Column(length255nullabletrue)]
  40.     private ?string $slug null;
  41.     #[ORM\Column(length255nullabletrue)]
  42.     private ?string $imagefront null;
  43.     #[ORM\Column(length255nullabletrue)]
  44.     private ?string $valeurreduction null;
  45.     #[ORM\ManyToMany(targetEntityFormation::class, inversedBy'offres')]
  46.     private Collection $formation;
  47.     #[ORM\OneToMany(mappedBy'offres'targetEntityOffresinscrit::class,cascade: ['remove'])]
  48.     private Collection $inscrit;
  49.     #[ORM\OneToMany(mappedBy'offres'targetEntityVoucher::class,cascade: ['remove'])]
  50.     private Collection $voucher;
  51.     public function __construct()
  52.     {
  53.         $this->formation = new ArrayCollection();
  54.         $this->inscrit = new ArrayCollection();
  55.         $this->voucher = new ArrayCollection();
  56.     }
  57.     public function getId(): ?int
  58.     {
  59.         return $this->id;
  60.     }
  61.     public function getTitre(): ?string
  62.     {
  63.         return $this->titre;
  64.     }
  65.     public function setTitre(?string $titre): self
  66.     {
  67.         $this->titre $titre;
  68.         return $this;
  69.     }
  70.     public function getPrix(): ?string
  71.     {
  72.         return $this->prix;
  73.     }
  74.     public function setPrix(?string $prix): self
  75.     {
  76.         $this->prix $prix;
  77.         return $this;
  78.     }
  79.     public function getOption1(): ?string
  80.     {
  81.         return $this->option1;
  82.     }
  83.     public function setOption1(?string $option1): self
  84.     {
  85.         $this->option1 $option1;
  86.         return $this;
  87.     }
  88.     public function getOption2(): ?string
  89.     {
  90.         return $this->option2;
  91.     }
  92.     public function setOption2(?string $option2): self
  93.     {
  94.         $this->option2 $option2;
  95.         return $this;
  96.     }
  97.     public function getOption3(): ?string
  98.     {
  99.         return $this->option3;
  100.     }
  101.     public function setOption3(?string $option3): self
  102.     {
  103.         $this->option3 $option3;
  104.         return $this;
  105.     }
  106.     public function getOption4(): ?string
  107.     {
  108.         return $this->option4;
  109.     }
  110.     public function setOption4(?string $option4): self
  111.     {
  112.         $this->option4 $option4;
  113.         return $this;
  114.     }
  115.     public function getOption5(): ?string
  116.     {
  117.         return $this->option5;
  118.     }
  119.     public function setOption5(?string $option5): self
  120.     {
  121.         $this->option5 $option5;
  122.         return $this;
  123.     }
  124.     public function getDuree(): ?string
  125.     {
  126.         return $this->duree;
  127.     }
  128.     public function setDuree(?string $duree): self
  129.     {
  130.         $this->duree $duree;
  131.         return $this;
  132.     }
  133.     public function getDateexp(): ?\DateTimeInterface
  134.     {
  135.         return $this->dateexp;
  136.     }
  137.     public function setDateexp(?\DateTimeInterface $dateexp): self
  138.     {
  139.         $this->dateexp $dateexp;
  140.         return $this;
  141.     }
  142.     public function getAffiche(): ?string
  143.     {
  144.         return $this->affiche;
  145.     }
  146.     public function setAffiche(?string $affiche): self
  147.     {
  148.         $this->affiche $affiche;
  149.         return $this;
  150.     }
  151.     public function getDescription(): ?string
  152.     {
  153.         return $this->description;
  154.     }
  155.     public function setDescription(?string $description): self
  156.     {
  157.         $this->description $description;
  158.         return $this;
  159.     }
  160.     public function getSlug(): ?string
  161.     {
  162.         return $this->slug;
  163.     }
  164.     public function setSlug(?string $slug): self
  165.     {
  166.         $this->slug $slug;
  167.         return $this;
  168.     }
  169.     public function getImagefront(): ?string
  170.     {
  171.         return $this->imagefront;
  172.     }
  173.     public function setImagefront(?string $imagefront): self
  174.     {
  175.         $this->imagefront $imagefront;
  176.         return $this;
  177.     }
  178.     public function getValeurreduction(): ?string
  179.     {
  180.         return $this->valeurreduction;
  181.     }
  182.     public function setValeurreduction(?string $valeurreduction): self
  183.     {
  184.         $this->valeurreduction $valeurreduction;
  185.         return $this;
  186.     }
  187.     /**
  188.      * @return Collection<int, Formation>
  189.      */
  190.     public function getFormation(): Collection
  191.     {
  192.         return $this->formation;
  193.     }
  194.     public function addFormation(Formation $formation): self
  195.     {
  196.         if (!$this->formation->contains($formation)) {
  197.             $this->formation->add($formation);
  198.         }
  199.         return $this;
  200.     }
  201.     public function removeFormation(Formation $formation): self
  202.     {
  203.         $this->formation->removeElement($formation);
  204.         return $this;
  205.     }
  206.     /**
  207.      * @return Collection<int, Offresinscrit>
  208.      */
  209.     public function getInscrit(): Collection
  210.     {
  211.         return $this->inscrit;
  212.     }
  213.     public function addInscrit(Offresinscrit $inscrit): self
  214.     {
  215.         if (!$this->inscrit->contains($inscrit)) {
  216.             $this->inscrit->add($inscrit);
  217.             $inscrit->setOffres($this);
  218.         }
  219.         return $this;
  220.     }
  221.     public function removeInscrit(Offresinscrit $inscrit): self
  222.     {
  223.         if ($this->inscrit->removeElement($inscrit)) {
  224.             // set the owning side to null (unless already changed)
  225.             if ($inscrit->getOffres() === $this) {
  226.                 $inscrit->setOffres(null);
  227.             }
  228.         }
  229.         return $this;
  230.     }
  231.     /**
  232.      * @return Collection<int, Voucher>
  233.      */
  234.     public function getVoucher(): Collection
  235.     {
  236.         return $this->voucher;
  237.     }
  238.     public function addVoucher(Voucher $voucher): self
  239.     {
  240.         if (!$this->voucher->contains($voucher)) {
  241.             $this->voucher->add($voucher);
  242.             $voucher->setOffres($this);
  243.         }
  244.         return $this;
  245.     }
  246.     public function removeVoucher(Voucher $voucher): self
  247.     {
  248.         if ($this->voucher->removeElement($voucher)) {
  249.             // set the owning side to null (unless already changed)
  250.             if ($voucher->getOffres() === $this) {
  251.                 $voucher->setOffres(null);
  252.             }
  253.         }
  254.         return $this;
  255.     }
  256. }