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

76 lines
2.2 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model;
class Currency extends Model
{
public function __construct()
{
$this
->addRule('symbol', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Currency symbol.',
'example' => '$',
])
->addRule('name', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Currency name.',
'example' => 'US dollar',
])
->addRule('symbolNative', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Currency native symbol.',
'example' => '$',
])
->addRule('decimalDigits', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_INTEGER,
'description' => 'Number of decimal digits.',
'example' => 2,
])
->addRule('rounding', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_FLOAT,
'description' => 'Currency digit rounding.',
'example' => 0,
])
->addRule('code', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Currency code in [ISO 4217-1](http://en.wikipedia.org/wiki/ISO_4217) three-character format.',
'example' => 'USD',
])
->addRule('namePlural', [
2020-11-07 22:14:48 +00:00
'type' => self::TYPE_STRING,
'description' => 'Currency plural name',
'example' => 'US dollars',
])
// ->addRule('locations', [
2020-11-07 22:14:48 +00:00
// 'type' => self::TYPE_STRING,
// 'description' => 'Currency locations list. List of location in two-character ISO 3166-1 alpha code.',
// 'example' => ['US'],
// 'array' => true,
// ])
;
}
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'Currency';
}
/**
* Get Collection
*
* @return string
*/
public function getType():string
{
return Response::MODEL_CURRENCY;
}
}