src/Entity/Section.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use App\Repository\SectionRepository;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use Symfony\Component\Serializer\Annotation\Groups;
  9. #[ORM\Entity(repositoryClassSectionRepository::class)]
  10. #[ApiResource(normalizationContext: ['groups' => ['Section_read']])]
  11. class Section
  12. {
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     #[Groups(['Section_read''Formation_read'])]
  17.     private ?int $id null;
  18.     #[ORM\Column(length255nullabletrue)]
  19.     #[Groups(['Section_read''Formation_read'])]
  20.     private ?string $titre null;
  21.     #[ORM\Column(length255nullabletrue)]
  22.     #[Groups(['Section_read''Formation_read'])]
  23.     private ?string $duree null;
  24.     #[ORM\ManyToOne(inversedBy'sections')]
  25.     private ?Formation $formation null;
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getTitre(): ?string
  31.     {
  32.         return $this->titre;
  33.     }
  34.     public function setTitre(?string $titre): self
  35.     {
  36.         $this->titre $titre;
  37.         return $this;
  38.     }
  39.     public function getDuree(): ?string
  40.     {
  41.         return $this->duree;
  42.     }
  43.     public function setDuree(?string $duree): self
  44.     {
  45.         $this->duree $duree;
  46.         return $this;
  47.     }
  48.     public function getFormation(): ?Formation
  49.     {
  50.         return $this->formation;
  51.     }
  52.     public function setFormation(?Formation $formation): self
  53.     {
  54.         $this->formation $formation;
  55.         return $this;
  56.     }
  57. }