diff --git a/README-CN.md b/README-CN.md index 3c411ee826..bfbd98fb74 100644 --- a/README-CN.md +++ b/README-CN.md @@ -24,7 +24,7 @@ [English](README.md) | 简体中文 -[**我们发布了 Appwrite Console 2.0 版本,点击这里了解更多!**](https://medium.com/appwrite-io/announcing-console-2-0-2e0e96891cb0?source=friends_link&sk=7a82b4069778e3adc165dc026e960fe1) +[**宣布带有数据库关系的 Appwrite 1.3!了解最新消息!**](https://dev.to/appwrite/join-celebrations-appwrite-13-ships-relationships-57fc) Appwrite是一个基于Docker的端到端开发者平台,其容器化的微服务库可应用于网页端,移动端,以及后端。Appwrite 通过视觉化界面简化了从零开始编写 API 的繁琐过程,在保证软件安全的前提下为开发者创造了一个高效的开发环境。 diff --git a/README.md b/README.md index bfb58aa60e..962fab5e01 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ English | [简体中文](README-CN.md) - +[**Announcing Appwrite 1.3 with Database Relationships! Learn what's new!**](https://dev.to/appwrite/join-celebrations-appwrite-13-ships-relationships-57fc) Appwrite is an end-to-end backend server for Web, Mobile, Native, or Backend apps packaged as a set of Docker microservices. Appwrite abstracts the complexity and repetitiveness required to build a modern backend API from scratch and allows you to build secure apps faster. diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 11d67232c7..dd5ac4a2da 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -1356,7 +1356,7 @@ App::get('/v1/account/prefs') ->inject('user') ->action(function (Response $response, Document $user) { - $prefs = $user->getAttribute('prefs', new \stdClass()); + $prefs = $user->getAttribute('prefs', []); $response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES); }); diff --git a/app/controllers/api/teams.php b/app/controllers/api/teams.php index fbe7fd5398..338af70406 100644 --- a/app/controllers/api/teams.php +++ b/app/controllers/api/teams.php @@ -223,7 +223,7 @@ App::get('/v1/teams/:teamId/prefs') throw new Exception(Exception::TEAM_NOT_FOUND); } - $prefs = $team->getAttribute('prefs', new \stdClass()); + $prefs = $team->getAttribute('prefs', []); $response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES); }); diff --git a/app/controllers/api/users.php b/app/controllers/api/users.php index 7e7e342de9..ceed901a32 100644 --- a/app/controllers/api/users.php +++ b/app/controllers/api/users.php @@ -457,7 +457,7 @@ App::get('/v1/users/:userId/prefs') throw new Exception(Exception::USER_NOT_FOUND); } - $prefs = $user->getAttribute('prefs', new \stdClass()); + $prefs = $user->getAttribute('prefs', []); $response->dynamic(new Document($prefs), Response::MODEL_PREFERENCES); }); diff --git a/src/Appwrite/Migration/Version/V18.php b/src/Appwrite/Migration/Version/V18.php index 2fedf4957e..eba19fa861 100644 --- a/src/Appwrite/Migration/Version/V18.php +++ b/src/Appwrite/Migration/Version/V18.php @@ -33,9 +33,7 @@ class V18 extends Migration $this->migrateCollections(); Console::info('Migrating Documents'); - $this->forEachDocument(function (Document $document) { - $this->migrateDocument($document); - }); + $this->forEachDocument([$this, 'fixDocument']); } /** @@ -131,7 +129,7 @@ class V18 extends Migration * @param Document $document * @return Document */ - private function migrateDocument(Document $document): Document + protected function fixDocument(Document $document): Document { switch ($document->getCollection()) { case 'projects':