<?phpnamespace App\Entity;use App\Repository\CityRepository;use App\Trait\GeographicCoordinates;use Doctrine\DBAL\Types\Types;use Doctrine\ORM\Mapping as ORM;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: CityRepository::class)]#[UniqueEntity(['name'])]class City{ use GeographicCoordinates; #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'string', length: 50)] #[Assert\NotBlank] #[Assert\Length(min: 3, max: 50)] #[Assert\Regex( pattern: '/^[\p{L}\p{M}\s\'-]+$/u', )] private ?string $name; #[ORM\Column(type: 'boolean')] private bool $active; #[ORM\ManyToOne(targetEntity: Country::class)] #[ORM\JoinColumn(nullable: false)] private ?Country $country = null; #[ORM\OneToOne(cascade: ['persist', 'remove'])] private ?FileData $image = null; #[ORM\Column(type: Types::TEXT, nullable: true)] private ?string $description = null; #[ORM\Column(nullable: true)] private ?bool $stateTransfer = null; public function __construct() { } 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 isActive(): ?bool { return $this->active; } public function setActive(bool $active): self { $this->active = $active; return $this; } public function __toString(): string { return $this->name; } public function getCountry(): ?Country { return $this->country; } public function setCountry(?Country $country): self { $this->country = $country; return $this; } public function getImage(): ?FileData { return $this->image; } public function setImage(?FileData $image): static { $this->image = $image; return $this; } public function getDescription(): ?string { return $this->description; } public function setDescription(?string $description): static { $this->description = $description; return $this; } public function isStateTransfer(): ?bool { return $this->stateTransfer; } public function setStateTransfer(?bool $stateTransfer): static { $this->stateTransfer = $stateTransfer; return $this; }}