<?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();
    }

}