Files
omair saleh 05401f6bbc large commit
2021-03-11 13:06:40 +08:00

63 lines
1.1 KiB
PHP

<?php
namespace App\Classes\Modules\Countries\DataTransferObjects;
use App\Classes\General\Interfaces\DataTransferObject;
use Rinvex\Country\Country;
class CountryObject implements DataTransferObject
{
/** @var Country */
private $country;
/**
* CountryObject constructor.
* @param Country $country
*/
public function __construct(Country $country)
{
$this->country = $country;
}
/**
* @return Country
*/
public function getCountry(): Country
{
return $this->country;
}
/**
* @return string
*/
public function getName(): string
{
return $this->getCountry()->getName();
}
/**
* @return string
*/
public function getShortCode(): string
{
return $this->getCountry()->getIsoAlpha2();
}
/**
* @return int
*/
public function getPhoneCode(): int
{
return $this->getCountry()->getCallingCode();
}
/**
* @return string
*/
public function getSvg(): string
{
return $this->getCountry()->getFlag();
}
}