1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/AttributeFloat.php

51 lines
1.1 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model\Attribute;
class AttributeFloat extends Attribute
{
public function __construct()
{
$this
->addRule('min', [
'type' => self::TYPE_FLOAT,
'description' => 'Minimum value to enforce on new documents.',
'default' => null,
'example' => 0.5,
'array' => false,
'required' => false,
])
->addRule('max', [
'type' => self::TYPE_FLOAT,
'description' => 'Minimum value to enforce on new documents.',
'default' => null,
'example' => 2.5,
'array' => false,
'required' => false,
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'AttributeFloat';
}
/**
* Get Collection
*
* @return string
*/
public function getType():string
{
return Response::MODEL_ATTRIBUTE_FLOAT;
}
}