src/Entity/Customer.php line 11
<?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{#[ORM\Id]#[ORM\GeneratedValue]#[ORM\Column]private ?int $id = null;#[ORM\Column(length: 255)]private ?string $fullName = null;#[ORM\Column(length: 255, nullable: true)]private ?string $email = null;#[ORM\Column(length: 50, nullable: true)]private ?string $phoneNumber = null;#[ORM\Column(length: 255, nullable: true)]private ?string $address = null;#[ORM\Column]private ?float $credit = null;#[ORM\OneToMany(mappedBy: 'customer', targetEntity: Order::class)]private Collection $orders;public function __construct(){$this->orders = new ArrayCollection();$this->credit = 0;}public function getId(): ?int{return $this->id;}public function getFullName(): ?string{return $this->fullName;}public function setFullName(string $fullName): self{$this->fullName = $fullName;return $this;}public function getEmail(): ?string{return $this->email;}public function setEmail(?string $email): self{$this->email = $email;return $this;}public function getPhoneNumber(): ?string{return $this->phoneNumber;}public function setPhoneNumber(?string $phoneNumber): self{$this->phoneNumber = $phoneNumber;return $this;}public function getAddress(): ?string{return $this->address;}public function setAddress(?string $address): self{$this->address = $address;return $this;}public function getCredit(): ?float{return $this->credit;}public function setCredit(float $credit): self{$this->credit = $credit;return $this;}/*** @return Collection<int, Order>*/public function getOrders(): Collection{return $this->orders;}public function addOrder(Order $order): self{if (!$this->orders->contains($order)) {$this->orders->add($order);$order->setCustomer($this);}return $this;}public function removeOrder(Order $order): self{if ($this->orders->removeElement($order)) {// set the owning side to null (unless already changed)if ($order->getCustomer() === $this) {$order->setCustomer(null);}}return $this;}public function __toString(): string{return $this->fullName;}}