private function createCountry(DOMElement $element)
    {
        if ($element->hasAttribute('common_name')) {
            $short = $element->getAttribute('common_name');
        } else {
            $short = $element->getAttribute('name');
        }

        if ($element->hasAttribute('official_name')) {
            $long = $element->getAttribute('official_name');
        } else {
            $long = null;
        }

        return new Country(
            $element->getAttribute('alpha_2_code'),
            $element->getAttribute('alpha_3_code'),
            $long,
            $element->getAttribute('numeric_code'),
            $short
        );
    }
private function createCountry(DOMElement $element)
    {
        if ($element->hasAttribute('common_name')) {
            $short = $element->getAttribute('common_name');
        } else {
            $short = $element->getAttribute('name');
        }

        if ($element->hasAttribute('official_name')) {
            $long = $element->getAttribute('official_name');
        } else {
            $long = null;
        }

        return new Country(
            $element->getAttribute('alpha_2_code'),
            $element->getAttribute('alpha_3_code'),
            $long,
            $element->getAttribute('numeric_code'),
            $short
        );
    }
private function createCountry ( DOMElement $ element ) { if ( $ element -> hasAttribute ( 'common_name' ) ) { $ short = $ element -> getAttribute ( 'common_name' ) ; } else { $ short = $ element -> getAttribute ( 'name' ) ; } if ( $ element -> hasAttribute ( 'official_name' ) ) { $ long = $ element -> getAttribute ( 'official_name' ) ; } else { $ long = null ; } return new Country ( $ element -> getAttribute ( 'alpha_2_code' ) , $ element -> getAttribute ( 'alpha_3_code' ) , $ long , $ element -> getAttribute ( 'numeric_code' ) , $ short ) ; }
Creates a new Country using an XML element.

@param DOMElement $element An element.

@return Country A new country.
Creates a new Country using an XML element .