| 1 | <?php |
||
| 5 | class Locale |
||
| 6 | { |
||
| 7 | /** |
||
| 8 | * Country code. |
||
| 9 | * |
||
| 10 | * @var string |
||
| 11 | */ |
||
| 12 | protected $country; |
||
| 13 | |||
| 14 | /** |
||
| 15 | * IETF Code. |
||
| 16 | * |
||
| 17 | * @var string |
||
| 18 | */ |
||
| 19 | protected $ietfCode; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Language code. |
||
| 23 | * |
||
| 24 | * @var string |
||
| 25 | */ |
||
| 26 | protected $language; |
||
| 27 | |||
| 28 | /** |
||
| 29 | * Locale name. |
||
| 30 | * |
||
| 31 | * @var string |
||
| 32 | */ |
||
| 33 | protected $name; |
||
| 34 | |||
| 35 | /** |
||
| 36 | * Class constructor. |
||
| 37 | * |
||
| 38 | * @param string $name |
||
| 39 | * @param string $language |
||
| 40 | * @param string $country |
||
| 41 | */ |
||
| 42 | public function __construct($name, $language, $country) |
||
| 50 | |||
| 51 | /** |
||
| 52 | * Magic method to read data from inaccessible |
||
| 53 | * properties. |
||
| 54 | * |
||
| 55 | * @param string $name |
||
| 56 | * |
||
| 57 | * @return string |
||
| 58 | */ |
||
| 59 | public function __get(string $name): string |
||
| 63 | |||
| 64 | /** |
||
| 65 | * Magic method to determine if a variable is set |
||
| 66 | * and is not NULL. |
||
| 67 | * |
||
| 68 | * @param string $name |
||
| 69 | * |
||
| 70 | * @return bool |
||
| 71 | */ |
||
| 72 | public function __isset(string $name): bool |
||
| 76 | } |
||
| 77 |