feat(Product): Ajoute la relation avec l'entité FormulesProductInclus.
 feat(FormulesController): Crée le contrôleur pour gérer les formules.
 feat(templates): Ajoute le template pour afficher les formules dans le dashboard.
 feat(base.twig): Ajoute un lien vers la gestion des formules dans le menu.
⚙️ chore(vich_uploader): Configure vich uploader pour les images des formules.
```
This commit is contained in:
Serreau Jovann
2026-01-28 08:56:54 +01:00
parent ff9ae0e8d4
commit 349b5fc2cc
10 changed files with 516 additions and 0 deletions

View File

@@ -81,10 +81,17 @@ class Product
#[ORM\Column(nullable: true)]
private ?float $dimP = null;
/**
* @var Collection<int, FormulesProductInclus>
*/
#[ORM\OneToMany(targetEntity: FormulesProductInclus::class, mappedBy: 'PRODUCT')]
private Collection $formulesProductIncluses;
public function __construct()
{
$this->productReserves = new ArrayCollection();
$this->productDocs = new ArrayCollection();
$this->formulesProductIncluses = new ArrayCollection();
}
public function slug()
{
@@ -363,4 +370,34 @@ class Product
return $this;
}
/**
* @return Collection<int, FormulesProductInclus>
*/
public function getFormulesProductIncluses(): Collection
{
return $this->formulesProductIncluses;
}
public function addFormulesProductInclus(FormulesProductInclus $formulesProductInclus): static
{
if (!$this->formulesProductIncluses->contains($formulesProductInclus)) {
$this->formulesProductIncluses->add($formulesProductInclus);
$formulesProductInclus->setPRODUCT($this);
}
return $this;
}
public function removeFormulesProductInclus(FormulesProductInclus $formulesProductInclus): static
{
if ($this->formulesProductIncluses->removeElement($formulesProductInclus)) {
// set the owning side to null (unless already changed)
if ($formulesProductInclus->getPRODUCT() === $this) {
$formulesProductInclus->setPRODUCT(null);
}
}
return $this;
}
}