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

55 lines
1.2 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()
{
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,
2022-09-02 23:19:20 +00:00
'required' => false,
'example' => 'default',
])
;
}
2021-09-14 08:26:16 +00:00
public array $conditions = [
'type' => self::TYPE_STRING,
];
/**
* Get Name
2022-05-23 14:54:50 +00:00
*
* @return string
*/
2022-05-23 14:54:50 +00:00
public function getName(): string
{
return 'AttributeString';
}
/**
2021-09-15 15:17:09 +00:00
* Get Type
2022-05-23 14:54:50 +00:00
*
* @return string
*/
2022-05-23 14:54:50 +00:00
public function getType(): string
{
return Response::MODEL_ATTRIBUTE_STRING;
}
}