Linux SRV-16 6.18.44-paas #1 SMP PREEMPT_DYNAMIC Thu Aug 13 10:08:12 UTC 2026 x86_64
/
proc
/
212
/
root
/
proc
/
self
/
root
/
proc
/
212
/
root
/
proc
/
self
/
root
/
proc
/
70528
/
cwd
/
src
/
Entity
/
//proc/212/root/proc/self/root/proc/212/root/proc/self/root/proc/70528/cwd/src/Entity/Grammage.php
<?php namespace App\Entity; use App\Repository\GrammageRepository; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; use Doctrine\ORM\Mapping as ORM; /** * @ORM\Entity(repositoryClass=GrammageRepository::class) */ class Grammage { /** * @ORM\Id * @ORM\GeneratedValue * @ORM\Column(type="integer") */ private $id; /** * @ORM\Column(type="string", length=255) */ private $name; /** * @ORM\Column(type="string", length=255) */ private $price; /** * @ORM\ManyToMany(targetEntity=Product::class, mappedBy="grammages") */ private $products; /** * @ORM\Column(type="boolean") */ private $active; /** * @ORM\OneToMany(targetEntity=Price::class, mappedBy="grammage", orphanRemoval=true) */ private $prices; public function __construct() { $this->products = new ArrayCollection(); $this->active = true; $this->prices = 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 getPrice(): ?string { return $this->price; } public function setPrice(string $price): self { $this->price = $price; return $this; } /** * @return Collection<int, Product> */ public function getProducts(): Collection { return $this->products; } public function addProduct(Product $product): self { if (!$this->products->contains($product)) { $this->products[] = $product; $product->addGrammage($this); } return $this; } public function removeProduct(Product $product): self { if ($this->products->removeElement($product)) { $product->removeGrammage($this); } return $this; } public function isActive(): ?bool { return $this->active; } public function setActive(bool $active): self { $this->active = $active; return $this; } /** * @return Collection<int, Price> */ public function getPrices(): Collection { return $this->prices; } public function addPrice(Price $price): self { if (!$this->prices->contains($price)) { $this->prices[] = $price; $price->setGrammage($this); } return $this; } public function removePrice(Price $price): self { if ($this->prices->removeElement($price)) { // set the owning side to null (unless already changed) if ($price->getGrammage() === $this) { $price->setGrammage(null); } } return $this; } }