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

49 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 AttributeString extends Attribute
{
public function __construct()
{
$this
->addRule('size', [
'type' => self::TYPE_STRING,
'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,
2021-08-16 22:59:33 +00:00
'require' => false,
])
;
}
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'AttributeString';
}
/**
* Get Collection
*
* @return string
*/
public function getType():string
{
return Response::MODEL_ATTRIBUTE_STRING;
}
}