<?phpnamespace App\Entity;use App\Repository\CommercialSaleZoneRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;#[ORM\Entity(repositoryClass: CommercialSaleZoneRepository::class)]class CommercialSaleZone{ use IdentifiableTrait; #[ORM\Column(length: 255)] private ?string $name = null; #[ORM\Column(length: 5, nullable: true)] private ?string $number = null; #[ORM\Column] private ?int $position = null; #[ORM\ManyToMany(targetEntity: Commercial::class, mappedBy: 'saleZones')] private Collection $commercials; public function __construct() { $this->commercials = new ArrayCollection(); } public function __toString(): string { return $this->name . ' (' . $this->number . ')'; } 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 getPosition(): ?int { return $this->position; } public function setPosition(int $position): self { $this->position = $position; return $this; } /** * @return Collection<int, Commercial> */ public function getCommercials(): Collection { return $this->commercials; } public function addCommercial(Commercial $commercial): self { if (!$this->commercials->contains($commercial)) { $this->commercials->add($commercial); $commercial->addSaleZone($this); } return $this; } public function removeCommercial(Commercial $commercial): self { if ($this->commercials->removeElement($commercial)) { $commercial->removeSaleZone($this); } return $this; } public function getNumber(): ?string { return $this->number; } public function setNumber(?string $number): self { $this->number = $number; return $this; }}