src/Entity/CountryPhoneCode.php line 15

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Entity;
  4. use App\Repository\CountryPhoneCodeRepository;
  5. use Doctrine\ORM\Mapping\Column;
  6. use Doctrine\ORM\Mapping\Entity;
  7. use Doctrine\ORM\Mapping\GeneratedValue;
  8. use Doctrine\ORM\Mapping\Id;
  9. use Doctrine\ORM\Mapping\ManyToOne;
  10. #[Entity(CountryPhoneCodeRepository::class)]
  11. class CountryPhoneCode
  12. {
  13.     #[Id]
  14.     #[GeneratedValue]
  15.     #[Column(name'id'type'integer'options: ['unsigned' => true])]
  16.     private ?int $id null;
  17.     #[Column(name'code'type'integer'options: ['unsigned' => true])]
  18.     private int $code;
  19.     #[ManyToOne(targetEntityCountry::class, inversedBy'phoneCodes')]
  20.     private Country $country;
  21.     public function __construct(int $codeCountry $country)
  22.     {
  23.         $this->code $code;
  24.         $this->country $country;
  25.     }
  26.     public function getId(): ?int
  27.     {
  28.         return $this->id;
  29.     }
  30.     public function getCode(): int
  31.     {
  32.         return $this->code;
  33.     }
  34.     public function getCountry(): Country
  35.     {
  36.         return $this->country;
  37.     }
  38. }