appwrite/src/Appwrite/Utopia/Response/Model/Phone.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 Phone extends Model
{
public function __construct()
{
$this
->addRule('code', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Phone code.',
2021-01-13 15:06:36 +00:00
'default' => '',
'example' => '+1',
])
->addRule('countryCode', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Country two-character ISO 3166-1 alpha code.',
2021-01-13 15:06:36 +00:00
'default' => '',
'example' => 'US',
])
->addRule('countryName', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Country name.',
2021-01-13 15:06:36 +00:00
'default' => '',
'example' => 'United States',
])
;
}
/**
* Get Name
*
* @return string
*/
2022-05-23 14:54:50 +00:00
public function getName(): string
{
return 'Phone';
}
/**
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_PHONE;
}
}