From af13b4c22fc902c13e7bad476a92c5e2a7125570 Mon Sep 17 00:00:00 2001 From: kenjis Date: Tue, 12 Jul 2022 16:00:29 +0900 Subject: [PATCH] docs: update about UserModel::insert() and update() --- docs/quickstart.md | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) diff --git a/docs/quickstart.md b/docs/quickstart.md index ffc055f4c..86eeb3f2c 100644 --- a/docs/quickstart.md +++ b/docs/quickstart.md @@ -296,7 +296,7 @@ NOTE: The User rows use [soft deletes](https://codeigniter.com/user_guide/models ### Editing A User -The `UserModel::save()` method has been modified to ensure that an email or password previously set on the `User` entity will be automatically updated in the correct `UserIdentity` record. +The `UserModel::save()`, `update()` and `insert()` methods have been modified to ensure that an email or password previously set on the `User` entity will be automatically updated in the correct `UserIdentity` record. ```php $users = model('UserModel'); @@ -309,21 +309,3 @@ $user->fill([ ]); $users->save($user); ``` - -If you prefer to use the `update()` method then you will have to update the user's appropriate UserIdentity manually. - -```php -$users = model('UserModel'); -$user = $users->findById(123); - -$user->fill([ - 'username' => 'JoeSmith111', - 'email' => 'joe.smith@example.com', - 'password' => 'secret123' -]); - -// Saves the username field -$users->update($user); -// Updates the email and password -$user->saveEmailIdentity(); -```