Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/examples/databases/create-line-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ $result = $databases->createLineAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
default: [[1, 2], [3, 4], [5, 6]] // optional
);
2 changes: 1 addition & 1 deletion docs/examples/databases/create-point-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ $result = $databases->createPointAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
default: [1, 2] // optional
);
2 changes: 1 addition & 1 deletion docs/examples/databases/create-polygon-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ $result = $databases->createPolygonAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional
);
2 changes: 1 addition & 1 deletion docs/examples/databases/update-line-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ $result = $databases->updateLineAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
default: [[1, 2], [3, 4], [5, 6]], // optional
newKey: '' // optional
);
2 changes: 1 addition & 1 deletion docs/examples/databases/update-point-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ $result = $databases->updatePointAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
default: [1, 2], // optional
newKey: '' // optional
);
2 changes: 1 addition & 1 deletion docs/examples/databases/update-polygon-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ $result = $databases->updatePolygonAttribute(
collectionId: '<COLLECTION_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional
newKey: '' // optional
);
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/create-line-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ $result = $tablesDB->createLineColumn(
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
default: [[1, 2], [3, 4], [5, 6]] // optional
);
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/create-point-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ $result = $tablesDB->createPointColumn(
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
default: [1, 2] // optional
);
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/create-polygon-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ $result = $tablesDB->createPolygonColumn(
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]] // optional
default: [[[1, 2], [3, 4], [5, 6], [1, 2]]] // optional
);
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/update-line-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ $result = $tablesDB->updateLineColumn(
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
default: [[1, 2], [3, 4], [5, 6]], // optional
newKey: '' // optional
);
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/update-point-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ $result = $tablesDB->updatePointColumn(
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
default: [1, 2], // optional
newKey: '' // optional
);
2 changes: 1 addition & 1 deletion docs/examples/tablesdb/update-polygon-column.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ $result = $tablesDB->updatePolygonColumn(
tableId: '<TABLE_ID>',
key: '',
required: false,
default: [[1,2], [3, 4]], // optional
default: [[[1, 2], [3, 4], [5, 6], [1, 2]]], // optional
newKey: '' // optional
);
2 changes: 1 addition & 1 deletion docs/tablesdb.md
Original file line number Diff line number Diff line change
Expand Up @@ -800,7 +800,7 @@ POST https://cloud.appwrite.io/v1/tablesdb/{databaseId}/tables/{tableId}/rows
| --- | --- | --- | --- |
| databaseId | string | **Required** Database ID. | |
| tableId | string | **Required** Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/server/tablesdb#tablesDBCreate). Make sure to define columns before creating rows. | |
| rows | array | Array of documents data as JSON objects. | [] |
| rows | array | Array of rows data as JSON objects. | [] |


```http request
Expand Down
4 changes: 2 additions & 2 deletions src/Appwrite/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ class Client
*/
protected array $headers = [
'content-type' => '',
'user-agent' => 'AppwritePHPSDK/17.0.0 ()',
'user-agent' => 'AppwritePHPSDK/17.1.0 ()',
'x-sdk-name'=> 'PHP',
'x-sdk-platform'=> 'server',
'x-sdk-language'=> 'php',
'x-sdk-version'=> '17.0.0',
'x-sdk-version'=> '17.1.0',
];

/**
Expand Down
10 changes: 10 additions & 0 deletions src/Appwrite/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,16 @@ public static function orderDesc(string $attribute): string
return (new Query('orderDesc', $attribute, null))->__toString();
}

/**
* Order Random
*
* @return string
*/
public static function orderRandom(): string
{
return (new Query('orderRandom', null, null))->__toString();
}

/**
* Limit
*
Expand Down
4 changes: 4 additions & 0 deletions tests/Appwrite/QueryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,10 @@ public function testOrderDesc(): void {
$this->assertSame('orderDesc("attr")', Query::orderDesc('attr'));
}

public function testOrderRandom(): void {
$this->assertSame('{"method":"orderRandom"}', Query::orderRandom());
}

public function testCursorBefore(): void {
$this->assertSame('cursorBefore("attr")', Query::cursorBefore('attr'));
}
Expand Down
12 changes: 6 additions & 6 deletions tests/Appwrite/Services/FunctionsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -304,12 +304,12 @@ public function testMethodCreateDeployment(): void {
"providerRepositoryName" => "database",
"providerRepositoryOwner" => "utopia",
"providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function",
"providerBranch" => "0.7.x",
"providerCommitHash" => "7c3f25d",
"providerCommitAuthorUrl" => "https://github.com/vermakhushboo",
"providerCommitAuthor" => "Khushboo Verma",
"providerCommitMessage" => "Update index.js",
"providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb",
"providerBranch" => "0.7.x",
"providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",);


Expand Down Expand Up @@ -349,12 +349,12 @@ public function testMethodCreateDuplicateDeployment(): void {
"providerRepositoryName" => "database",
"providerRepositoryOwner" => "utopia",
"providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function",
"providerBranch" => "0.7.x",
"providerCommitHash" => "7c3f25d",
"providerCommitAuthorUrl" => "https://github.com/vermakhushboo",
"providerCommitAuthor" => "Khushboo Verma",
"providerCommitMessage" => "Update index.js",
"providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb",
"providerBranch" => "0.7.x",
"providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",);


Expand Down Expand Up @@ -393,12 +393,12 @@ public function testMethodCreateTemplateDeployment(): void {
"providerRepositoryName" => "database",
"providerRepositoryOwner" => "utopia",
"providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function",
"providerBranch" => "0.7.x",
"providerCommitHash" => "7c3f25d",
"providerCommitAuthorUrl" => "https://github.com/vermakhushboo",
"providerCommitAuthor" => "Khushboo Verma",
"providerCommitMessage" => "Update index.js",
"providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb",
"providerBranch" => "0.7.x",
"providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",);


Expand Down Expand Up @@ -440,12 +440,12 @@ public function testMethodCreateVcsDeployment(): void {
"providerRepositoryName" => "database",
"providerRepositoryOwner" => "utopia",
"providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function",
"providerBranch" => "0.7.x",
"providerCommitHash" => "7c3f25d",
"providerCommitAuthorUrl" => "https://github.com/vermakhushboo",
"providerCommitAuthor" => "Khushboo Verma",
"providerCommitMessage" => "Update index.js",
"providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb",
"providerBranch" => "0.7.x",
"providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",);


Expand Down Expand Up @@ -485,12 +485,12 @@ public function testMethodGetDeployment(): void {
"providerRepositoryName" => "database",
"providerRepositoryOwner" => "utopia",
"providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function",
"providerBranch" => "0.7.x",
"providerCommitHash" => "7c3f25d",
"providerCommitAuthorUrl" => "https://github.com/vermakhushboo",
"providerCommitAuthor" => "Khushboo Verma",
"providerCommitMessage" => "Update index.js",
"providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb",
"providerBranch" => "0.7.x",
"providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",);


Expand Down Expand Up @@ -563,12 +563,12 @@ public function testMethodUpdateDeploymentStatus(): void {
"providerRepositoryName" => "database",
"providerRepositoryOwner" => "utopia",
"providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function",
"providerBranch" => "0.7.x",
"providerCommitHash" => "7c3f25d",
"providerCommitAuthorUrl" => "https://github.com/vermakhushboo",
"providerCommitAuthor" => "Khushboo Verma",
"providerCommitMessage" => "Update index.js",
"providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb",
"providerBranch" => "0.7.x",
"providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",);


Expand Down
12 changes: 6 additions & 6 deletions tests/Appwrite/Services/SitesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,12 @@ public function testMethodCreateDeployment(): void {
"providerRepositoryName" => "database",
"providerRepositoryOwner" => "utopia",
"providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function",
"providerBranch" => "0.7.x",
"providerCommitHash" => "7c3f25d",
"providerCommitAuthorUrl" => "https://github.com/vermakhushboo",
"providerCommitAuthor" => "Khushboo Verma",
"providerCommitMessage" => "Update index.js",
"providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb",
"providerBranch" => "0.7.x",
"providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",);


Expand Down Expand Up @@ -355,12 +355,12 @@ public function testMethodCreateDuplicateDeployment(): void {
"providerRepositoryName" => "database",
"providerRepositoryOwner" => "utopia",
"providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function",
"providerBranch" => "0.7.x",
"providerCommitHash" => "7c3f25d",
"providerCommitAuthorUrl" => "https://github.com/vermakhushboo",
"providerCommitAuthor" => "Khushboo Verma",
"providerCommitMessage" => "Update index.js",
"providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb",
"providerBranch" => "0.7.x",
"providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",);


Expand Down Expand Up @@ -399,12 +399,12 @@ public function testMethodCreateTemplateDeployment(): void {
"providerRepositoryName" => "database",
"providerRepositoryOwner" => "utopia",
"providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function",
"providerBranch" => "0.7.x",
"providerCommitHash" => "7c3f25d",
"providerCommitAuthorUrl" => "https://github.com/vermakhushboo",
"providerCommitAuthor" => "Khushboo Verma",
"providerCommitMessage" => "Update index.js",
"providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb",
"providerBranch" => "0.7.x",
"providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",);


Expand Down Expand Up @@ -446,12 +446,12 @@ public function testMethodCreateVcsDeployment(): void {
"providerRepositoryName" => "database",
"providerRepositoryOwner" => "utopia",
"providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function",
"providerBranch" => "0.7.x",
"providerCommitHash" => "7c3f25d",
"providerCommitAuthorUrl" => "https://github.com/vermakhushboo",
"providerCommitAuthor" => "Khushboo Verma",
"providerCommitMessage" => "Update index.js",
"providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb",
"providerBranch" => "0.7.x",
"providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",);


Expand Down Expand Up @@ -491,12 +491,12 @@ public function testMethodGetDeployment(): void {
"providerRepositoryName" => "database",
"providerRepositoryOwner" => "utopia",
"providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function",
"providerBranch" => "0.7.x",
"providerCommitHash" => "7c3f25d",
"providerCommitAuthorUrl" => "https://github.com/vermakhushboo",
"providerCommitAuthor" => "Khushboo Verma",
"providerCommitMessage" => "Update index.js",
"providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb",
"providerBranch" => "0.7.x",
"providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",);


Expand Down Expand Up @@ -569,12 +569,12 @@ public function testMethodUpdateDeploymentStatus(): void {
"providerRepositoryName" => "database",
"providerRepositoryOwner" => "utopia",
"providerRepositoryUrl" => "https://github.com/vermakhushboo/g4-node-function",
"providerBranch" => "0.7.x",
"providerCommitHash" => "7c3f25d",
"providerCommitAuthorUrl" => "https://github.com/vermakhushboo",
"providerCommitAuthor" => "Khushboo Verma",
"providerCommitMessage" => "Update index.js",
"providerCommitUrl" => "https://github.com/vermakhushboo/g4-node-function/commit/60c0416257a9cbcdd96b2d370c38d8f8d150ccfb",
"providerBranch" => "0.7.x",
"providerBranchUrl" => "https://github.com/vermakhushboo/appwrite/tree/0.7.x",);


Expand Down