1
0
Fork 0
mirror of synced 2024-05-15 10:12:40 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/AttributeString.php
2022-01-06 12:41:58 +01:00

56 lines
1.2 KiB
PHP

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model\Attribute;
class AttributeString extends Attribute
{
public function __construct()
{
parent::__construct();
$this
->addRule('size', [
'type' => self::TYPE_INTEGER,
'description' => 'Attribute size.',
'default' => 0,
'example' => 128,
])
->addRule('default', [
'type' => self::TYPE_STRING,
'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.',
'default' => null,
'example' => 'default',
'array' => false,
'require' => false,
])
;
}
public array $conditions = [
'type' => self::TYPE_STRING,
];
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'AttributeString';
}
/**
* Get Type
*
* @return string
*/
public function getType():string
{
return Response::MODEL_ATTRIBUTE_STRING;
}
}