<?phpnamespace App\Entity;use App\Repository\GroupeDemandeRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Knp\DoctrineBehaviors\Contract\Entity\BlameableInterface;use Knp\DoctrineBehaviors\Contract\Entity\TimestampableInterface;use Knp\DoctrineBehaviors\Model\Blameable\BlameableTrait;use Knp\DoctrineBehaviors\Model\Timestampable\TimestampableTrait;#[ORM\Entity(repositoryClass: GroupeDemandeRepository::class)]class GroupeDemande implements BlameableInterface, TimestampableInterface{ use BlameableTrait; use TimestampableTrait; #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\ManyToOne(inversedBy: 'groupeDemandes')] #[ORM\JoinColumn(nullable: false)] private ?Prestation $cycle = null; #[ORM\OneToMany(mappedBy: 'groupeDemande', targetEntity: DemandeService::class)] private Collection $demandes; public function __construct() { $this->demandes = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getName(): ?string { return $this->name; } public function setName(string $name): self { $this->name = $name; return $this; } public function getCycle(): ?Prestation { return $this->cycle; } public function setCycle(?Prestation $cycle): self { $this->cycle = $cycle; return $this; } /** * @return Collection<int, DemandeService> */ public function getDemandes(): Collection { return $this->demandes; } public function addDemande(DemandeService $demande): self { if (!$this->demandes->contains($demande)) { $this->demandes->add($demande); $demande->setGroupeDemande($this); } return $this; } public function removeDemande(DemandeService $demande): self { if ($this->demandes->removeElement($demande)) { // set the owning side to null (unless already changed) if ($demande->getGroupeDemande() === $this) { $demande->setGroupeDemande(null); } } return $this; } public function __toString(): string { return $this->name; }}