We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e25ecc commit f1894c9Copy full SHA for f1894c9
src/Entities/User.php
@@ -40,7 +40,7 @@ class User extends Entity
40
* @var array<string, string>
41
*/
42
protected $casts = [
43
- 'id' => 'integer',
+ 'id' => '?integer',
44
'active' => 'boolean',
45
'permissions' => 'array',
46
'groups' => 'array',
src/Models/UserModel.php
@@ -298,9 +298,7 @@ protected function saveEmailIdentity(array $data): array
298
}
299
300
// Insert
301
- // If we use Entity Property Casting ['id' => 'integer'],
302
- // `id` returns 0 when not set.
303
- if ($this->tempUser->id === null || $this->tempUser->id === 0) {
+ if ($this->tempUser->id === null) {
304
/** @var User $user */
305
$user = $this->find($this->db->insertID());
306
0 commit comments