<?phpnamespace App\Entity;use App\Repository\ProductRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: ProductRepository::class)]class Product{ use IdentifiableTrait; #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\Column(length: 255)] private ?string $reference = null; #[ORM\Column] private ?bool $active = null; #[ORM\OneToMany(mappedBy: 'product', targetEntity: InvoiceLine::class)] private Collection $invoiceLines; #[ORM\Column(nullable: true)] private ?bool $showInStats = null; #[ORM\OneToMany(mappedBy: 'product', targetEntity: Dotation::class)] private Collection $dotations; #[ORM\Column(nullable: true)] private ?bool $isDotation = null; #[ORM\ManyToOne(inversedBy: 'products')] private ?ProductCategory $category = null; #[ORM\Column(nullable: true)] private ?bool $isInStockDotation = null; public function __construct() { $this->invoiceLines = new ArrayCollection(); $this->dotations = new ArrayCollection(); } public function __toString(): string { return $this->name; } 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 getReference(): ?string { return $this->reference; } public function setReference(string $reference): self { $this->reference = $reference; return $this; } public function isActive(): ?bool { return $this->active; } public function setActive(bool $active): self { $this->active = $active; return $this; } /** * @return Collection<int, InvoiceLine> */ public function getInvoiceLines(): Collection { return $this->invoiceLines; } public function addInvoiceLine(InvoiceLine $invoiceLine): self { if (!$this->invoiceLines->contains($invoiceLine)) { $this->invoiceLines->add($invoiceLine); $invoiceLine->setProduct($this); } return $this; } public function removeInvoiceLine(InvoiceLine $invoiceLine): self { if ($this->invoiceLines->removeElement($invoiceLine)) { // set the owning side to null (unless already changed) if ($invoiceLine->getProduct() === $this) { $invoiceLine->setProduct(null); } } return $this; } public function isShowInStats(): ?bool { return $this->showInStats; } public function setShowInStats(?bool $showInStats): self { $this->showInStats = $showInStats; return $this; } /** * @return Collection<int, VisitReport> */ public function getDotations(): Collection { return $this->dotations; } public function isIsDotation(): ?bool { return $this->isDotation; } public function setIsDotation(?bool $isDotation): static { $this->isDotation = $isDotation; return $this; } public function getCategory(): ?ProductCategory { return $this->category; } public function setCategory(?ProductCategory $category): static { $this->category = $category; return $this; } public function isIsInStockDotation(): ?bool { return $this->isInStockDotation; } public function setIsInStockDotation(?bool $isInStockDotation): static { $this->isInStockDotation = $isInStockDotation; return $this; }}