40 lines
778 B
PHP
40 lines
778 B
PHP
<?php
|
|
|
|
// Exit if accessed directly
|
|
defined( 'ABSPATH' ) || exit;
|
|
|
|
class Wiaas_User_Profile {
|
|
|
|
const LIST_OF_COUNTRIES = [
|
|
array(
|
|
'idCountry' => '1',
|
|
'countryName' => 'Sweden'
|
|
),
|
|
array(
|
|
'idCountry' => '2',
|
|
'countryName' => 'Finland'
|
|
),
|
|
array(
|
|
'idCountry' => '3',
|
|
'countryName' => 'Denmark'
|
|
)
|
|
];
|
|
|
|
public static function get_list_of_countries(){
|
|
return self::LIST_OF_COUNTRIES;
|
|
}
|
|
|
|
public static function check_country_id($id){
|
|
foreach (self::LIST_OF_COUNTRIES as $country){
|
|
if ($country['idCountry'] === $id) return true;
|
|
}
|
|
return false;
|
|
}
|
|
|
|
public static function get_country_name_by_id($id){
|
|
foreach(self::LIST_OF_COUNTRIES as $country){
|
|
if ($country['idCountry'] === $id) return $country['countryName'];
|
|
}
|
|
return '';
|
|
}
|
|
} |