public static function getCode($val, $alpha3 = false)
    {
        if (self::$_countryFlip === array()) {
            self::$_countryFlip = array_flip(self::$_countries);
        }
        if (!array_key_exists($val, self::$_countryFlip)) {
            return null;
        }
        $result = self::$_countryFlip[$val];
        if ($alpha3) {
            return self::$_tlcMap[$result];
        }
        return $result;
    }
public static function getCode($val, $alpha3 = false)
    {
        if (self::$_countryFlip === array()) {
            self::$_countryFlip = array_flip(self::$_countries);
        }
        if (!array_key_exists($val, self::$_countryFlip)) {
            return null;
        }
        $result = self::$_countryFlip[$val];
        if ($alpha3) {
            return self::$_tlcMap[$result];
        }
        return $result;
    }
public static function getCode ( $ val , $ alpha3 = false ) { if ( self :: $ _countryFlip === array ( ) ) { self :: $ _countryFlip = array_flip ( self :: $ _countries ) ; } if ( ! array_key_exists ( $ val , self :: $ _countryFlip ) ) { return null ; } $ result = self :: $ _countryFlip [ $ val ] ; if ( $ alpha3 ) { return self :: $ _tlcMap [ $ result ] ; } return $ result ; }
Converts a KlarnaCountry constant to the respective country code.

@param int  $val    KlarnaCountry constant
@param bool $alpha3 Whether to return a ISO-3166-1 alpha-3 code

@return string|null
Converts a KlarnaCountry constant to the respective country code .