2020-10-30 02:07:56 +13:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Appwrite\Utopia\Response\Model;
|
|
|
|
|
|
|
|
use Appwrite\Utopia\Response;
|
|
|
|
use Appwrite\Utopia\Response\Model;
|
|
|
|
|
|
|
|
class Country extends Model
|
|
|
|
{
|
|
|
|
public function __construct()
|
|
|
|
{
|
|
|
|
$this
|
|
|
|
->addRule('name', [
|
2020-11-08 11:14:48 +13:00
|
|
|
'type' => self::TYPE_STRING,
|
2020-10-30 02:07:56 +13:00
|
|
|
'description' => 'Country name.',
|
2021-01-14 04:06:36 +13:00
|
|
|
'default' => '',
|
2020-10-30 02:07:56 +13:00
|
|
|
'example' => 'United States',
|
|
|
|
])
|
|
|
|
->addRule('code', [
|
2020-11-08 11:14:48 +13:00
|
|
|
'type' => self::TYPE_STRING,
|
2020-10-30 02:07:56 +13:00
|
|
|
'description' => 'Country two-character ISO 3166-1 alpha code.',
|
2021-01-14 04:06:36 +13:00
|
|
|
'default' => '',
|
2020-10-30 02:07:56 +13:00
|
|
|
'example' => 'US',
|
|
|
|
])
|
|
|
|
;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get Name
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getName():string
|
|
|
|
{
|
|
|
|
return 'Country';
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Get Collection
|
|
|
|
*
|
|
|
|
* @return string
|
|
|
|
*/
|
|
|
|
public function getType():string
|
|
|
|
{
|
|
|
|
return Response::MODEL_COUNTRY;
|
|
|
|
}
|
|
|
|
}
|