mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 20:43:56 +00:00
63 lines
1.1 KiB
PHP
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();
|
|
}
|
|
|
|
} |