<?phpnamespace App\Entity;use App\Repository\PackRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: PackRepository::class)]class Pack{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column] private ?int $id = null; #[ORM\Column(length: 255, nullable: true)] private ?string $libelle = null; #[ORM\Column(nullable: true)] private ?float $prix = null; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $description = null; #[ORM\Column(length: 255, nullable: true)] private ?string $slug = null; #[ORM\OneToMany(mappedBy: 'pack', targetEntity: PackItem::class,cascade: ['remove'])] private Collection $packItems; #[ORM\Column(length: 255, nullable: true)] private ?string $image = null; #[ORM\OneToMany(mappedBy: 'pack', targetEntity: CommandeFormation::class)] private Collection $commandeFormations; public function __construct() { $this->packItems = new ArrayCollection(); $this->commandeFormations = new ArrayCollection(); } public function getId(): ?int { return $this->id; } public function getLibelle(): ?string { return $this->libelle; } public function setLibelle(?string $libelle): self { $this->libelle = $libelle; return $this; } public function getPrix(): ?float { return $this->prix; } public function setPrix(?float $prix): self { $this->prix = $prix; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): self { $this->description = $description; return $this; } public function getSlug(): ?string { return $this->slug; } public function setSlug(?string $slug): self { $this->slug = $slug; return $this; } /** * @return Collection<int, PackItem> */ public function getPackItems(): Collection { return $this->packItems; } public function addPackItem(PackItem $packItem): self { if (!$this->packItems->contains($packItem)) { $this->packItems->add($packItem); $packItem->setPack($this); } return $this; } public function removePackItem(PackItem $packItem): self { if ($this->packItems->removeElement($packItem)) { // set the owning side to null (unless already changed) if ($packItem->getPack() === $this) { $packItem->setPack(null); } } return $this; } public function getImage(): ?string { return $this->image; } public function setImage(?string $image): self { $this->image = $image; return $this; } /** * @return Collection<int, CommandeFormation> */ public function getCommandeFormations(): Collection { return $this->commandeFormations; } public function addCommandeFormation(CommandeFormation $commandeFormation): self { if (!$this->commandeFormations->contains($commandeFormation)) { $this->commandeFormations->add($commandeFormation); $commandeFormation->setPack($this); } return $this; } public function removeCommandeFormation(CommandeFormation $commandeFormation): self { if ($this->commandeFormations->removeElement($commandeFormation)) { // set the owning side to null (unless already changed) if ($commandeFormation->getPack() === $this) { $commandeFormation->setPack(null); } } return $this; }}