src/Entity/City.php line 13
<?phpnamespace App\Entity;use App\Repository\CityRepository;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Doctrine\ORM\Mapping as ORM;use Symfony\Component\Serializer\Annotation\Groups;use Symfony\Component\Uid\Uuid;#[ORM\Entity(repositoryClass: CityRepository::class)]class City{#[ORM\Id]#[ORM\Column(type: 'uuid', unique: true)]#[Groups(['BASE'])]private ?string $id = null;#[ORM\Column(length: 255)]private ?string $name = null;#[ORM\Column(length: 255)]private ?string $code = null;#[ORM\OneToMany(mappedBy: 'city', targetEntity: Property::class)]private Collection $properties;public function __construct(){$this->id = Uuid::v4();$this->properties = new ArrayCollection();}public function getId(): ?string{return $this->id;}public function __toString(){return $this->getName();}public function getName(): ?string{return $this->name;}public function setName(string $name): static{$this->name = $name;return $this;}public function getCode(): ?string{return $this->code;}public function setCode(string $code): static{$this->code = $code;return $this;}/*** @return Collection<int, Property>*/public function getProperties(): Collection{return $this->properties;}public function addProperty(Property $property): static{if (!$this->properties->contains($property)) {$this->properties->add($property);$property->setCity($this);}return $this;}public function removeStore(Property $property): static{if ($this->properties->removeElement($property)) {// set the owning side to null (unless already changed)if ($property->getCity() === $this) {$property->setCity(null);}}return $this;}}