diff --git a/src/Appwrite/Utopia/Database/Validator/Queries/Base.php b/src/Appwrite/Utopia/Database/Validator/Queries/Base.php index c99a76d31e..a1aec7c1ed 100644 --- a/src/Appwrite/Utopia/Database/Validator/Queries/Base.php +++ b/src/Appwrite/Utopia/Database/Validator/Queries/Base.php @@ -11,7 +11,7 @@ use Utopia\Database\Validator\Query\Filter; use Utopia\Database\Validator\Query\Limit; use Utopia\Database\Validator\Query\Offset; use Utopia\Database\Validator\Query\Order; -use Appwrite\Utopia\Database\Validator\Query\Select; +use Utopia\Database\Validator\Query\Select; class Base extends Queries { diff --git a/src/Appwrite/Utopia/Database/Validator/Query/Select.php b/src/Appwrite/Utopia/Database/Validator/Query/Select.php deleted file mode 100644 index 2afe7cc5d6..0000000000 --- a/src/Appwrite/Utopia/Database/Validator/Query/Select.php +++ /dev/null @@ -1,58 +0,0 @@ -schema[$attribute->getAttribute('key')] = $attribute->getAttribute('type'); - } - } - - protected function isValidAttribute(string $attribute): bool - { - if (str_starts_with($attribute, '$')) { - return true; // Allow system attributes - } - - return array_key_exists($attribute, $this->schema); - } - - public function isValid(mixed $query): bool - { - if (!$query instanceof \Utopia\Database\Query) { - return false; - } - - if ($query->getMethod() !== Query::TYPE_SELECT) { - return false; - } - - $values = $query->getValues(); - - foreach ($values as $attribute) { - if (!$this->isValidAttribute($attribute)) { - $this->message = 'Query select is not valid: Attribute "' . $attribute . '" not found.'; - return false; - } - } - - return true; - } - - public function getType(): string - { - return Query::TYPE_SELECT; - } -} \ No newline at end of file