```
✨ feat(Product.php): Ajoute la liaison ManyToMany avec l'entité Options ✨ feat(Devis.php): Ajoute la propriété isNotAddCaution pour masquer la caution ♻️ refactor(.env): Met à jour les URLs de SIGN, STRIPE et CONTRAT ✨ feat(workflow.twig): Adapte le workflow et supprime l'étape de caution ✨ feat(NewDevisType.php): Ajoute un champ pour gérer
This commit is contained in:
@@ -108,6 +108,12 @@ class Product
|
||||
#[ORM\Column(nullable: true, options: ['default' => true])]
|
||||
private ?bool $isPublish = true;
|
||||
|
||||
/**
|
||||
* @var Collection<int, Options>
|
||||
*/
|
||||
#[ORM\ManyToMany(targetEntity: Options::class, inversedBy: 'products')]
|
||||
private Collection $options;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->productReserves = new ArrayCollection();
|
||||
@@ -116,6 +122,7 @@ class Product
|
||||
$this->productPhotos = new ArrayCollection();
|
||||
$this->productVideos = new ArrayCollection();
|
||||
$this->productBlockeds = new ArrayCollection();
|
||||
$this->options = new ArrayCollection();
|
||||
$this->isPublish = true;
|
||||
}
|
||||
public function slug()
|
||||
@@ -527,4 +534,28 @@ class Product
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Collection<int, Options>
|
||||
*/
|
||||
public function getOptions(): Collection
|
||||
{
|
||||
return $this->options;
|
||||
}
|
||||
|
||||
public function addOption(Options $option): static
|
||||
{
|
||||
if (!$this->options->contains($option)) {
|
||||
$this->options->add($option);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function removeOption(Options $option): static
|
||||
{
|
||||
$this->options->removeElement($option);
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user