<?phpnamespace App\Entity;use App\Repository\WarehouseRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: WarehouseRepository::class)]class Warehouse{ use IdentifiableTrait; #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\Column(length: 255)] private ?string $slug = null; #[ORM\Column(length: 255)] private ?string $code = null; #[ORM\Column] private ?bool $active = null; #[ORM\OneToMany(mappedBy: 'warehouse', targetEntity: Invoice::class)] private Collection $invoices; public function __construct() { $this->invoices = 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 getSlug(): ?string { return $this->slug; } public function setSlug(string $slug): self { $this->slug = $slug; return $this; } public function getCode(): ?string { return $this->code; } public function setCode(string $code): self { $this->code = $code; return $this; } public function isActive(): ?bool { return $this->active; } public function setActive(bool $active): self { $this->active = $active; return $this; } /** * @return Collection<int, Invoice> */ public function getInvoices(): Collection { return $this->invoices; } public function addInvoice(Invoice $invoice): self { if (!$this->invoices->contains($invoice)) { $this->invoices->add($invoice); $invoice->setWarehouse($this); } return $this; } public function removeInvoice(Invoice $invoice): self { if ($this->invoices->removeElement($invoice)) { // set the owning side to null (unless already changed) if ($invoice->getWarehouse() === $this) { $invoice->setWarehouse(null); } } return $this; }}