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

49 lines
1 KiB
PHP
Raw Normal View History

<?php
namespace Appwrite\Utopia\Response\Model;
use Appwrite\Utopia\Response;
use Appwrite\Utopia\Response\Model\Attribute;
class AttributeBoolean extends Attribute
{
public function __construct()
{
parent::__construct();
$this
->addRule('default', [
'type' => self::TYPE_BOOLEAN,
'description' => 'Default value for attribute when not provided. Cannot be set when attribute is required.',
'default' => null,
'example' => false,
'array' => false,
2021-08-16 22:59:33 +00:00
'require' => false,
])
;
}
2021-09-14 08:26:16 +00:00
public array $conditions = [
'type' => self::TYPE_BOOLEAN
];
/**
* Get Name
*
* @return string
*/
public function getName():string
{
return 'AttributeBoolean';
}
/**
* Get Collection
*
* @return string
*/
public function getType():string
{
return Response::MODEL_ATTRIBUTE_BOOLEAN;
}
}