<?phpnamespace App\Entity;use App\Repository\CustomerRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CustomerRepository::class)]class Customer{ use IdentifiableTrait; #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\OneToMany(mappedBy: 'customer', targetEntity: Invoice::class)] private Collection $invoices; #[ORM\Column(length: 255)] private ?string $code = null; #[ORM\Column(length: 255, nullable: true)] private ?string $email = null; #[ORM\ManyToOne(inversedBy: 'customers')] private ?CustomerCategory $category = null; public function __construct() { $this->invoices = new ArrayCollection(); } public function __toString(): string { return $this->getName(); } 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; } /** * @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->setCustomer($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->getCustomer() === $this) { $invoice->setCustomer(null); } } return $this; } public function getCode(): ?string { return $this->code; } public function setCode(string $code): self { $this->code = $code; return $this; } public function getEmail(): ?string { return $this->email; } public function setEmail(?string $email): self { $this->email = $email; return $this; } public function getCategory(): ?CustomerCategory { return $this->category; } public function setCategory(?CustomerCategory $category): self { $this->category = $category; return $this; }}