<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use App\Repository\SectionRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Serializer\Annotation\Groups;
#[ORM\Entity(repositoryClass: SectionRepository::class)]
#[ApiResource(normalizationContext: ['groups' => ['Section_read']])]
class Section
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
#[Groups(['Section_read', 'Formation_read'])]
private ?int $id = null;
#[ORM\Column(length: 255, nullable: true)]
#[Groups(['Section_read', 'Formation_read'])]
private ?string $titre = null;
#[ORM\Column(length: 255, nullable: true)]
#[Groups(['Section_read', 'Formation_read'])]
private ?string $duree = null;
#[ORM\ManyToOne(inversedBy: 'sections')]
private ?Formation $formation = null;
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(): ?string
{
return $this->duree;
}
public function setDuree(?string $duree): self
{
$this->duree = $duree;
return $this;
}
public function getFormation(): ?Formation
{
return $this->formation;
}
public function setFormation(?Formation $formation): self
{
$this->formation = $formation;
return $this;
}
}