src/Entity/Country.php line 9

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CountryRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. #[ORM\Entity(repositoryClassCountryRepository::class), ORM\Table(name'countries')]
  6. class Country implements \Stringable
  7. {
  8.     #[ORM\IdORM\GeneratedValueORM\Column(type'integer')]
  9.     private $id;
  10.     #[ORM\Column(type'string'length255)]
  11.     private $name;
  12.     #[ORM\Column(type'string'length100uniquetrue)]
  13.     private $code;
  14.     public function getId(): ?int
  15.     {
  16.         return $this->id;
  17.     }
  18.     public function getName(): ?string
  19.     {
  20.         return $this->name;
  21.     }
  22.     public function setName(string $name): self
  23.     {
  24.         $this->name $name;
  25.         return $this;
  26.     }
  27.     public function getCode(): ?string
  28.     {
  29.         return $this->code;
  30.     }
  31.     public function setCode(string $code): self
  32.     {
  33.         $this->code $code;
  34.         return $this;
  35.     }
  36.     public function __toString(): string
  37.     {
  38.         return $this->getName();
  39.     }
  40. }