2020-10-29 13:07:56 +00:00
|
|
|
<?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,
|
2020-10-29 13:07:56 +00:00
|
|
|
'description' => 'Language name.',
|
2021-01-13 15:06:36 +00:00
|
|
|
'default' => '',
|
2020-10-29 13:07:56 +00:00
|
|
|
'example' => 'Italian',
|
|
|
|
|
])
|
|
|
|
|
->addRule('code', [
|
2020-11-07 22:14:48 +00:00
|
|
|
'type' => self::TYPE_STRING,
|
2020-10-29 13:07:56 +00:00
|
|
|
'description' => 'Language two-character ISO 639-1 codes.',
|
2021-01-13 15:06:36 +00:00
|
|
|
'default' => '',
|
2020-10-29 13:07:56 +00:00
|
|
|
'example' => 'it',
|
|
|
|
|
])
|
|
|
|
|
->addRule('nativeName', [
|
2020-11-07 22:14:48 +00:00
|
|
|
'type' => self::TYPE_STRING,
|
2020-10-29 13:07:56 +00:00
|
|
|
'description' => 'Language native name.',
|
2021-01-13 15:06:36 +00:00
|
|
|
'default' => '',
|
2020-10-29 13:07:56 +00:00
|
|
|
'example' => 'Italiano',
|
|
|
|
|
])
|
|
|
|
|
;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Get Name
|
2021-10-06 14:22:38 +00:00
|
|
|
*
|
2020-10-29 13:07:56 +00:00
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-05-23 14:54:50 +00:00
|
|
|
public function getName(): string
|
2020-10-29 13:07:56 +00:00
|
|
|
{
|
|
|
|
|
return 'Language';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2021-12-15 10:19:29 +00:00
|
|
|
* Get Type
|
2021-10-06 14:22:38 +00:00
|
|
|
*
|
2020-10-29 13:07:56 +00:00
|
|
|
* @return string
|
|
|
|
|
*/
|
2022-05-23 14:54:50 +00:00
|
|
|
public function getType(): string
|
2020-10-29 13:07:56 +00:00
|
|
|
{
|
|
|
|
|
return Response::MODEL_LANGUAGE;
|
|
|
|
|
}
|
2021-10-06 14:22:38 +00:00
|
|
|
}
|