appwrite/src/Appwrite/Utopia/Response/Model/LocaleCode.php
2023-04-17 02:10:17 +00:00

47 lines
1,009 B
PHP

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class LocaleCode extends Model
{
public function __construct()
{
$this
->addRule('code', [
'type' => self::TYPE_STRING,
'description' => 'Locale codes in [ISO 639-1](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes)',
'default' => '',
'example' => 'en-us',
])
->addRule('name', [
'type' => self::TYPE_STRING,
'description' => 'Locale name',
'default' => '',
'example' => 'US',
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName(): string
{
return 'LocaleCode';
}
/**
* Get Type
*
* @return string
*/
public function getType(): string
{
return Response::MODEL_LOCALE_CODE;
}
}