update resume method
This commit is contained in:
@ -2,12 +2,26 @@
|
||||
|
||||
namespace frontend\modules\api\models\resume;
|
||||
|
||||
use yii\helpers\ArrayHelper;
|
||||
use frontend\modules\card\models\UserCard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @OA\Schema(
|
||||
* schema="Resume",
|
||||
* type="array",
|
||||
* @OA\Items(
|
||||
* @OA\Property(
|
||||
* property="fio",
|
||||
* type="string",
|
||||
* example="ФИО",
|
||||
* description="ФИО"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="position",
|
||||
* type="string",
|
||||
* example="position",
|
||||
* description="Специализация"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="stack",
|
||||
* type="array",
|
||||
@ -23,6 +37,11 @@ use yii\helpers\ArrayHelper;
|
||||
* example="Резюме",
|
||||
* description="Тело резюме в HTML разметке"
|
||||
* ),
|
||||
* @OA\Property(
|
||||
* property="projects",
|
||||
* ref="#/components/schemas/UserCardPortfolioProjectsExample",
|
||||
* ),
|
||||
* ),
|
||||
*)
|
||||
*
|
||||
* @OA\Schema(
|
||||
@ -32,23 +51,37 @@ use yii\helpers\ArrayHelper;
|
||||
* ref="#/components/schemas/Resume",
|
||||
* ),
|
||||
*)
|
||||
* @property UserCard $userCard
|
||||
*/
|
||||
class Resume extends \common\models\User
|
||||
{
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
public function fields(): array
|
||||
{
|
||||
return [
|
||||
'stack' => function() {
|
||||
'fio' => function () {
|
||||
return $this->userCard->fio;
|
||||
},
|
||||
'position' => function () {
|
||||
return $this->userCard->position->name;
|
||||
},
|
||||
'stack' => function () {
|
||||
return $this->userCard->getSkillsName();
|
||||
|
||||
},
|
||||
'resume' => function () {
|
||||
return $this->userCard->vc_text;
|
||||
},
|
||||
'projects' => function () {
|
||||
return $this->userCard->userCardPortfolioProjects;
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
public function getUserCard()
|
||||
{
|
||||
return $this->hasOne(UserCard::class, ['id_user' => 'id']);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user