2020-06-23 09:55:45 +12:00
< ? php
2020-06-24 03:01:20 +12:00
namespace Appwrite\Utopia\Response\Model ;
2020-06-23 09:55:45 +12:00
2020-06-24 03:01:20 +12:00
use Appwrite\Utopia\Response ;
use Appwrite\Utopia\Response\Model ;
2020-06-23 09:55:45 +12:00
2020-06-24 03:01:20 +12:00
class Locale extends Model
2020-06-23 09:55:45 +12:00
{
public function __construct ()
{
$this
-> addRule ( 'ip' , [
2020-11-08 11:14:48 +13:00
'type' => self :: TYPE_STRING ,
2020-06-23 09:55:45 +12:00
'description' => 'User IP address.' ,
2021-01-14 04:06:36 +13:00
'default' => '' ,
2020-06-23 09:55:45 +12:00
'example' => '127.0.0.1' ,
])
-> addRule ( 'countryCode' , [
2020-11-08 11:14:48 +13:00
'type' => self :: TYPE_STRING ,
2020-06-23 09:55:45 +12:00
'description' => 'Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format' ,
2021-01-14 04:06:36 +13:00
'default' => '' ,
2020-06-23 09:55:45 +12:00
'example' => 'US' ,
])
-> addRule ( 'country' , [
2020-11-08 11:14:48 +13:00
'type' => self :: TYPE_STRING ,
2020-06-23 09:55:45 +12:00
'description' => 'Country name. This field support localization.' ,
2021-01-14 04:06:36 +13:00
'default' => '' ,
2020-06-23 09:55:45 +12:00
'example' => 'United States' ,
])
-> addRule ( 'continentCode' , [
2020-11-08 11:14:48 +13:00
'type' => self :: TYPE_STRING ,
2020-06-23 09:55:45 +12:00
'description' => 'Continent code. A two character continent code "AF" for Africa, "AN" for Antarctica, "AS" for Asia, "EU" for Europe, "NA" for North America, "OC" for Oceania, and "SA" for South America.' ,
2021-01-14 04:06:36 +13:00
'default' => '' ,
2020-06-23 09:55:45 +12:00
'example' => 'NA' ,
])
-> addRule ( 'continent' , [
2020-11-08 11:14:48 +13:00
'type' => self :: TYPE_STRING ,
2020-06-23 09:55:45 +12:00
'description' => 'Continent name. This field support localization.' ,
2021-01-14 04:06:36 +13:00
'default' => '' ,
2020-06-23 09:55:45 +12:00
'example' => 'North America' ,
])
-> addRule ( 'eu' , [
2020-11-08 11:14:48 +13:00
'type' => self :: TYPE_BOOLEAN ,
2020-06-23 09:55:45 +12:00
'description' => 'True if country is part of the Europian Union.' ,
'default' => false ,
'example' => false ,
])
-> addRule ( 'currency' , [
2020-11-08 11:14:48 +13:00
'type' => self :: TYPE_STRING ,
2020-06-23 09:55:45 +12:00
'description' => 'Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format' ,
2021-01-14 04:06:36 +13:00
'default' => '' ,
2020-06-23 09:55:45 +12:00
'example' => 'USD' ,
])
;
}
/**
* Get Name
2021-10-07 03:22:38 +13:00
*
2020-06-23 09:55:45 +12:00
* @ return string
*/
public function getName () : string
{
2020-06-24 03:01:20 +12:00
return 'Locale' ;
2020-06-23 09:55:45 +12:00
}
/**
2021-12-15 23:19:29 +13:00
* Get Type
2021-10-07 03:22:38 +13:00
*
2020-06-23 09:55:45 +12:00
* @ return string
*/
2020-06-24 03:01:20 +12:00
public function getType () : string
2020-06-23 09:55:45 +12:00
{
2020-06-24 03:01:20 +12:00
return Response :: MODEL_LOCALE ;
2020-06-23 09:55:45 +12:00
}
2021-10-07 03:22:38 +13:00
}