<?phpnamespace App\Entity;use App\Repository\CountryRepository;use Doctrine\DBAL\Types\Types;;use Doctrine\ORM\Mapping as ORM;use Doctrine\Common\Collections\ArrayCollection;use Doctrine\Common\Collections\Collection;use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;use Symfony\Component\Validator\Constraints as Assert;#[ORM\Entity(repositoryClass: CountryRepository::class)]#[UniqueEntity(['name'])]class Country{ #[ORM\Id] #[ORM\GeneratedValue] #[ORM\Column(type: 'integer')] private $id; #[ORM\Column(type: 'string', length: 64, unique: true)] #[Assert\NotBlank] #[Assert\Length(min: 3, max: 64)] #[Assert\Regex( pattern: '/^[\p{L}\p{M}\s\'-]+$/u', )] private ?string $name = null; #[ORM\ManyToOne(targetEntity: Continent::class)] private ?Continent $continent; #[ORM\Column(type: 'boolean')] private bool $active; #[ORM\Column(length: 3, nullable: true)] private ?string $currency = null; #[Assert\NotBlank] #[Assert\Positive] #[Assert\LessThanOrEqual(value: 999)] #[ORM\Column(type: Types::SMALLINT, nullable: true)] private ?int $prefix = null; #[Assert\NotBlank] #[ORM\Column(length: 2, nullable: true)] private ?string $codeAlpha2 = null; public function getId() { return $this->id; } public function getName(): string { return $this->name; } public function setName(?string $name): self { $this->name = $name; return $this; } public function getContinent(): ?Continent { return $this->continent; } public function setContinent(Continent $continent): self { $this->continent = $continent; 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 getCurrency(): string { return $this->currency; } public function setCurrency(?string $currency): self { $this->currency = $currency; return $this; } public function getPrefix(): ?int { return $this->prefix; } public function setPrefix(?int $prefix): self { $this->prefix = $prefix; return $this; } public function getCodeAlpha2(): ?string { return $this->codeAlpha2; } public function setCodeAlpha2(?string $codeAlpha2): static { $this->codeAlpha2 = $codeAlpha2; return $this; }}