appwrite/src/Appwrite/Utopia/Response/Model/AttributePoint.php
2025-08-22 12:47:15 +05:30

59 lines
1.3 KiB
PHP

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