From 6eb1c3ae686ad9c549522a70aef5aa587103194c Mon Sep 17 00:00:00 2001 From: Darshan Date: Tue, 6 May 2025 16:58:56 +0530 Subject: [PATCH] update: rename remaining variables. --- .../Platform/Modules/Databases/Http/Rows/Create.php | 8 ++++---- .../Platform/Modules/Databases/Http/Rows/Delete.php | 6 +++--- src/Appwrite/Platform/Modules/Databases/Http/Rows/Get.php | 2 +- .../Platform/Modules/Databases/Http/Rows/Update.php | 8 ++++---- .../Platform/Modules/Databases/Http/Rows/XList.php | 2 +- .../Platform/Modules/Databases/Workers/Databases.php | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Rows/Create.php b/src/Appwrite/Platform/Modules/Databases/Http/Rows/Create.php index df36696d80..87078a5d3d 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Rows/Create.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Rows/Create.php @@ -175,7 +175,7 @@ class Create extends Action $relationships = \array_filter( $table->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + fn ($column) => $column->getAttribute('type') === Database::VAR_RELATIONSHIP ); foreach ($relationships as $relationship) { @@ -257,7 +257,7 @@ class Create extends Action $relationships = \array_filter( $table->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + fn ($column) => $column->getAttribute('type') === Database::VAR_RELATIONSHIP ); foreach ($relationships as $relationship) { @@ -296,10 +296,10 @@ class Create extends Action ->dynamic($row, UtopiaResponse::MODEL_ROW); $relationships = \array_map( - fn ($document) => $document->getAttribute('key'), + fn ($row) => $row->getAttribute('key'), \array_filter( $table->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + fn ($column) => $column->getAttribute('type') === Database::VAR_RELATIONSHIP ) ); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Rows/Delete.php b/src/Appwrite/Platform/Modules/Databases/Http/Rows/Delete.php index 8c68f23bfb..61cd4d218a 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Rows/Delete.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Rows/Delete.php @@ -112,7 +112,7 @@ class Delete extends Action $relationships = \array_filter( $table->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + fn ($column) => $column->getAttribute('type') === Database::VAR_RELATIONSHIP ); foreach ($relationships as $relationship) { @@ -147,10 +147,10 @@ class Delete extends Action $response->addHeader('X-Debug-Operations', 1); $relationships = \array_map( - fn ($document) => $document->getAttribute('key'), + fn ($row) => $row->getAttribute('key'), \array_filter( $table->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + fn ($column) => $column->getAttribute('type') === Database::VAR_RELATIONSHIP ) ); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Rows/Get.php b/src/Appwrite/Platform/Modules/Databases/Http/Rows/Get.php index 69127ca238..fb600f5a7f 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Rows/Get.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Rows/Get.php @@ -110,7 +110,7 @@ class Get extends Action $relationships = \array_filter( $table->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + fn ($column) => $column->getAttribute('type') === Database::VAR_RELATIONSHIP ); foreach ($relationships as $relationship) { diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Rows/Update.php b/src/Appwrite/Platform/Modules/Databases/Http/Rows/Update.php index 7dcd1f8fcb..5590aa6c67 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Rows/Update.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Rows/Update.php @@ -156,7 +156,7 @@ class Update extends Action $relationships = \array_filter( $table->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + fn ($column) => $column->getAttribute('type') === Database::VAR_RELATIONSHIP ); foreach ($relationships as $relationship) { @@ -253,7 +253,7 @@ class Update extends Action $relationships = \array_filter( $table->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + fn ($column) => $column->getAttribute('type') === Database::VAR_RELATIONSHIP ); foreach ($relationships as $relationship) { @@ -284,10 +284,10 @@ class Update extends Action $response->dynamic($row, UtopiaResponse::MODEL_ROW); $relationships = \array_map( - fn ($document) => $document->getAttribute('key'), + fn ($row) => $row->getAttribute('key'), \array_filter( $table->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + fn ($column) => $column->getAttribute('type') === Database::VAR_RELATIONSHIP ) ); diff --git a/src/Appwrite/Platform/Modules/Databases/Http/Rows/XList.php b/src/Appwrite/Platform/Modules/Databases/Http/Rows/XList.php index 95410507bf..781c0d7c83 100644 --- a/src/Appwrite/Platform/Modules/Databases/Http/Rows/XList.php +++ b/src/Appwrite/Platform/Modules/Databases/Http/Rows/XList.php @@ -136,7 +136,7 @@ class XList extends Action $relationships = \array_filter( $table->getAttribute('attributes', []), - fn ($attribute) => $attribute->getAttribute('type') === Database::VAR_RELATIONSHIP + fn ($column) => $column->getAttribute('type') === Database::VAR_RELATIONSHIP ); foreach ($relationships as $relationship) { diff --git a/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php b/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php index 6564239630..37fa7cf0cc 100644 --- a/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php +++ b/src/Appwrite/Platform/Modules/Databases/Workers/Databases.php @@ -539,9 +539,9 @@ class Databases extends Action Query::contains('options', ['"relatedCollection":"'. $collectionId .'"']), ], $dbForProject, - function ($attribute) use ($dbForProject, $databaseInternalId) { - $dbForProject->purgeCachedDocument('database_' . $databaseInternalId, $attribute->getAttribute('collectionId')); - $dbForProject->purgeCachedCollection('database_' . $databaseInternalId . '_collection_' . $attribute->getAttribute('collectionInternalId')); + function ($column) use ($dbForProject, $databaseInternalId) { + $dbForProject->purgeCachedDocument('database_' . $databaseInternalId, $column->getAttribute('collectionId')); + $dbForProject->purgeCachedCollection('database_' . $databaseInternalId . '_collection_' . $column->getAttribute('collectionInternalId')); } );