diff --git a/src/Appwrite/Utopia/Response/Model/ColumnIndex.php b/src/Appwrite/Utopia/Response/Model/ColumnIndex.php index bebc640fb2..547312d677 100644 --- a/src/Appwrite/Utopia/Response/Model/ColumnIndex.php +++ b/src/Appwrite/Utopia/Response/Model/ColumnIndex.php @@ -11,6 +11,24 @@ class ColumnIndex extends Model public function __construct() { $this + ->addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'Index ID.', + 'default' => '', + 'example' => '5e5ea5c16897e', + ]) + ->addRule('$createdAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Index creation date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('$updatedAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Index update date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) ->addRule('key', [ 'type' => self::TYPE_STRING, 'description' => 'Index Key.', @@ -56,18 +74,6 @@ class ColumnIndex extends Model 'example' => [], 'array' => true, 'required' => false, - ]) - ->addRule('$createdAt', [ - 'type' => self::TYPE_DATETIME, - 'description' => 'Index creation date in ISO 8601 format.', - 'default' => '', - 'example' => self::TYPE_DATETIME_EXAMPLE, - ]) - ->addRule('$updatedAt', [ - 'type' => self::TYPE_DATETIME, - 'description' => 'Index update date in ISO 8601 format.', - 'default' => '', - 'example' => self::TYPE_DATETIME_EXAMPLE, ]); } @@ -89,7 +95,6 @@ class ColumnIndex extends Model public function filter(Document $document): Document { - $columns = $document->getAttribute('attributes', []); $document ->removeAttribute('attributes') diff --git a/src/Appwrite/Utopia/Response/Model/Index.php b/src/Appwrite/Utopia/Response/Model/Index.php index fcd978b5be..62661738c2 100644 --- a/src/Appwrite/Utopia/Response/Model/Index.php +++ b/src/Appwrite/Utopia/Response/Model/Index.php @@ -10,9 +10,27 @@ class Index extends Model public function __construct() { $this + ->addRule('$id', [ + 'type' => self::TYPE_STRING, + 'description' => 'Index ID.', + 'default' => '', + 'example' => '5e5ea5c16897e', + ]) + ->addRule('$createdAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Index creation date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) + ->addRule('$updatedAt', [ + 'type' => self::TYPE_DATETIME, + 'description' => 'Index update date in ISO 8601 format.', + 'default' => '', + 'example' => self::TYPE_DATETIME_EXAMPLE, + ]) ->addRule('key', [ 'type' => self::TYPE_STRING, - 'description' => 'Index Key.', + 'description' => 'Index key.', 'default' => '', 'example' => 'index1', ]) @@ -55,18 +73,6 @@ class Index extends Model 'example' => [], 'array' => true, 'required' => false, - ]) - ->addRule('$createdAt', [ - 'type' => self::TYPE_DATETIME, - 'description' => 'Index creation date in ISO 8601 format.', - 'default' => '', - 'example' => self::TYPE_DATETIME_EXAMPLE, - ]) - ->addRule('$updatedAt', [ - 'type' => self::TYPE_DATETIME, - 'description' => 'Index update date in ISO 8601 format.', - 'default' => '', - 'example' => self::TYPE_DATETIME_EXAMPLE, ]); }