Merge remote-tracking branch 'origin/master'
This commit is contained in:
29
frontend/modules/api/models/User.php
Normal file
29
frontend/modules/api/models/User.php
Normal file
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
namespace frontend\modules\api\models;
|
||||
|
||||
use backend\modules\card\models\UserCardSearch;
|
||||
use common\services\ProfileService;
|
||||
|
||||
class User extends \common\models\User
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function fields(): array
|
||||
{
|
||||
return [
|
||||
'email',
|
||||
'username',
|
||||
'userCard' => function () {
|
||||
if(isset($this->userCard->id)){
|
||||
return ProfileService::getProfileById($this->userCard->id);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
];
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user