```
✨ 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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user