We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7d665d9 commit 4e4a5c8Copy full SHA for 4e4a5c8
1 file changed
yii2-adapter/src/IdentityWrapper.php
@@ -8,6 +8,7 @@
8
use CraftCms\Cms\Database\Table;
9
use CraftCms\Cms\Shared\Exceptions\NotSupportedException;
10
use CraftCms\Cms\Support\Json;
11
+use CraftCms\Cms\Support\Utils;
12
use CraftCms\Cms\User\Elements\User;
13
use Illuminate\Support\Facades\DB as DbFacade;
14
use Throwable;
@@ -18,15 +19,13 @@ class IdentityWrapper extends User implements IdentityInterface
18
19
{
20
public function __construct(User $user)
21
- foreach ($user->toArray() as $attribute => $value) {
22
+ foreach (Utils::getPublicProperties($user) as $attribute => $value) {
23
try {
24
$this->$attribute = $value;
25
} catch (Throwable) {
26
// Ignore
27
}
28
-
29
- parent::__construct();
30
31
32
public static function findIdentity($id): ?self
0 commit comments