src/Entity/Country.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Entity\Traits\TimeStampable;
  4. use App\Repository\CountryRepository;
  5. use Doctrine\ORM\Mapping as ORM;
  6. #[ORM\Entity(repositoryClass: CountryRepository::class)]
  7. #[ORM\HasLifecycleCallbacks]
  8. class Country
  9. {
  10.     use TimeStampable;
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id = null;
  15.     #[ORM\Column(length: 65)]
  16.     private ?string $name = null;
  17.     #[ORM\Column(length: 3, nullable: true)]
  18.     private ?string $isoCode = null;
  19.     #[ORM\Column(length: 6, nullable: true)]
  20.     private ?string $callingCode = null;
  21.     #[ORM\ManyToOne]
  22.     private ?Currency $currency = null;
  23.     #[ORM\ManyToOne]
  24.     private ?User $createdBy = null;
  25.     public function __construct()
  26.     {
  27.         $this->createdAt = new \DateTimeImmutable();
  28.         $this->updatedAt = new \DateTimeImmutable();
  29.     }
  30.     public function getId(): ?int
  31.     {
  32.         return $this->id;
  33.     }
  34.     public function getName(): ?string
  35.     {
  36.         return $this->name;
  37.     }
  38.     public function setName(string $name): self
  39.     {
  40.         $this->name = $name;
  41.         return $this;
  42.     }
  43.     public function getIsoCode(): ?string
  44.     {
  45.         return $this->isoCode;
  46.     }
  47.     public function setIsoCode(?string $isoCode): self
  48.     {
  49.         $this->isoCode = $isoCode;
  50.         return $this;
  51.     }
  52.     public function getCallingCode(): ?string
  53.     {
  54.         return $this->callingCode;
  55.     }
  56.     public function setCallingCode(?string $callingCode): self
  57.     {
  58.         $this->callingCode = $callingCode;
  59.         return $this;
  60.     }
  61.     public function getCurrency(): ?Currency
  62.     {
  63.         return $this->currency;
  64.     }
  65.     public function setCurrency(?Currency $currency): self
  66.     {
  67.         $this->currency = $currency;
  68.         return $this;
  69.     }
  70.     public function getCreatedBy(): ?User
  71.     {
  72.         return $this->createdBy;
  73.     }
  74.     public function setCreatedBy(?User $createdBy): self
  75.     {
  76.         $this->createdBy = $createdBy;
  77.         return $this;
  78.     }
  79. }