1
0
Fork 0
mirror of synced 2024-06-03 03:14:50 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/Locale.php

71 lines
2.2 KiB
PHP
Raw Normal View History

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', [
'type' => 'string',
'description' => 'User IP address.',
'example' => '127.0.0.1',
])
->addRule('countryCode', [
'type' => 'string',
'description' => 'Country code in [ISO 3166-1](http://en.wikipedia.org/wiki/ISO_3166-1) two-character format',
'example' => 'US',
])
->addRule('country', [
'type' => 'string',
'description' => 'Country name. This field support localization.',
'example' => 'United States',
])
->addRule('continentCode', [
'type' => 'string',
'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.',
'example' => 'NA',
])
->addRule('continent', [
'type' => 'string',
'description' => 'Continent name. This field support localization.',
'example' => 'North America',
])
->addRule('eu', [
'type' => 'Boolean',
'description' => 'True if country is part of the Europian Union.',
'default' => false,
'example' => false,
])
->addRule('currency', [
'type' => 'string',
'description' => 'Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format',
'example' => 'USD',
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName():string
{
2020-06-24 03:01:20 +12:00
return 'Locale';
2020-06-23 09:55:45 +12:00
}
/**
* Get Collection
*
* @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
}
}