2023-03-23 04:55:31 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace Appwrite\Utopia\Database\Validator\Queries;
|
|
|
|
|
|
|
|
|
|
use Appwrite\Utopia\Database\Validator\Queries;
|
|
|
|
|
use Appwrite\Utopia\Database\Validator\Query\Cursor;
|
|
|
|
|
use Appwrite\Utopia\Database\Validator\Query\Filter;
|
|
|
|
|
use Appwrite\Utopia\Database\Validator\Query\Limit;
|
|
|
|
|
use Appwrite\Utopia\Database\Validator\Query\Offset;
|
|
|
|
|
use Appwrite\Utopia\Database\Validator\Query\Order;
|
|
|
|
|
use Appwrite\Utopia\Database\Validator\Query\Select;
|
|
|
|
|
use Utopia\Database\Database;
|
|
|
|
|
|
2023-03-23 04:59:23 +00:00
|
|
|
class Document extends Queries
|
2023-03-23 04:55:31 +00:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Expression constructor
|
|
|
|
|
*
|
2023-03-23 04:59:23 +00:00
|
|
|
* @param array $attributes
|
2023-03-23 04:55:31 +00:00
|
|
|
* @throws \Exception
|
|
|
|
|
*/
|
|
|
|
|
public function __construct(array $attributes)
|
|
|
|
|
{
|
2023-03-23 04:59:23 +00:00
|
|
|
$attributes[] = new \Utopia\Database\Document([
|
2023-03-23 04:55:31 +00:00
|
|
|
'key' => '$id',
|
|
|
|
|
'type' => Database::VAR_STRING,
|
|
|
|
|
'array' => false,
|
|
|
|
|
]);
|
2023-03-23 04:59:23 +00:00
|
|
|
$attributes[] = new \Utopia\Database\Document([
|
2023-03-23 04:55:31 +00:00
|
|
|
'key' => '$createdAt',
|
|
|
|
|
'type' => Database::VAR_DATETIME,
|
|
|
|
|
'array' => false,
|
|
|
|
|
]);
|
2023-03-23 04:59:23 +00:00
|
|
|
$attributes[] = new \Utopia\Database\Document([
|
2023-03-23 04:55:31 +00:00
|
|
|
'key' => '$updatedAt',
|
|
|
|
|
'type' => Database::VAR_DATETIME,
|
|
|
|
|
'array' => false,
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
$validators = [
|
|
|
|
|
new Select($attributes),
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
parent::__construct(...$validators);
|
|
|
|
|
}
|
|
|
|
|
}
|