<?php
declare(strict_types=1);
namespace App\Entity;
use App\Repository\CountryPhoneCodeRepository;
use Doctrine\ORM\Mapping\Column;
use Doctrine\ORM\Mapping\Entity;
use Doctrine\ORM\Mapping\GeneratedValue;
use Doctrine\ORM\Mapping\Id;
use Doctrine\ORM\Mapping\ManyToOne;
#[Entity(CountryPhoneCodeRepository::class)]
class CountryPhoneCode
{
#[Id]
#[GeneratedValue]
#[Column(name: 'id', type: 'integer', options: ['unsigned' => true])]
private ?int $id = null;
#[Column(name: 'code', type: 'integer', options: ['unsigned' => true])]
private int $code;
#[ManyToOne(targetEntity: Country::class, inversedBy: 'phoneCodes')]
private Country $country;
public function __construct(int $code, Country $country)
{
$this->code = $code;
$this->country = $country;
}
public function getId(): ?int
{
return $this->id;
}
public function getCode(): int
{
return $this->code;
}
public function getCountry(): Country
{
return $this->country;
}
}