1
0
Fork 0
mirror of synced 2024-09-21 20:11:15 +12:00
appwrite/src/Appwrite/Utopia/Response/Model/AttributeEmail.php

58 lines
1.4 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model\Attribute;
class AttributeEmail extends Attribute
{
public function __construct()
{
parent::__construct();
$this
->addRule('format', [
'type' => self::TYPE_STRING,
'description' => 'String format.',
2021-08-24 09:25:32 +12:00
'default' => APP_DATABASE_ATTRIBUTE_EMAIL,
'example' => APP_DATABASE_ATTRIBUTE_EMAIL,
'array' => false,
2021-08-17 10:59:33 +12:00
'require' => true,
])
->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@example.com',
'array' => false,
2021-08-17 10:59:33 +12:00
'require' => false,
])
;
}
2021-09-14 20:26:16 +12:00
public array $conditions = [
'type' => self::TYPE_STRING,
'format' => \APP_DATABASE_ATTRIBUTE_EMAIL
];
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'AttributeEmail';
}
/**
2021-09-16 03:17:09 +12:00
* Get Type
*
* @return string
*/
public function getType():string
{
return Response::MODEL_ATTRIBUTE_EMAIL;
}
}