appwrite/src/Appwrite/Utopia/Response/Model/Language.php

54 lines
1.2 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Language extends Model
{
public function __construct()
{
$this
->addRule('name', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Language name.',
2021-01-13 15:06:36 +00:00
'default' => '',
'example' => 'Italian',
])
->addRule('code', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Language two-character ISO 639-1 codes.',
2021-01-13 15:06:36 +00:00
'default' => '',
'example' => 'it',
])
->addRule('nativeName', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Language native name.',
2021-01-13 15:06:36 +00:00
'default' => '',
'example' => 'Italiano',
])
;
}
/**
* Get Name
*
* @return string
*/
2022-05-23 14:54:50 +00:00
public function getName(): string
{
return 'Language';
}
/**
2021-12-15 10:19:29 +00:00
* Get Type
*
* @return string
*/
2022-05-23 14:54:50 +00:00
public function getType(): string
{
return Response::MODEL_LANGUAGE;
}
}