1 | <?php |
||
9 | class UserProfileForm extends \yii\base\Model |
||
10 | { |
||
11 | /** |
||
12 | * @var int |
||
13 | */ |
||
14 | public $user_id; |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | public $full_name; |
||
19 | /** |
||
20 | * @var string |
||
21 | */ |
||
22 | public $photo; |
||
23 | /** |
||
24 | * @var \app\models\entity\UserProfile |
||
25 | */ |
||
26 | private $model; |
||
27 | |||
28 | /** |
||
29 | * Creates a form model given a user profile |
||
30 | * |
||
31 | * @param UserProfile $model |
||
32 | * @param array $config name-value pairs that will be used to initialize the object properties |
||
33 | */ |
||
34 | public function __construct(UserProfile $model, $config = []) |
||
44 | |||
45 | |||
46 | /** |
||
47 | * @return array The validation rules |
||
48 | */ |
||
49 | 1 | public function rules() |
|
57 | |||
58 | /** |
||
59 | * @inheritdoc |
||
60 | */ |
||
61 | public function attributeLabels() |
||
69 | 1 | ||
70 | 1 | /** |
|
71 | 1 | * Get model |
|
72 | 1 | * |
|
73 | * @return UserProfile |
||
74 | */ |
||
75 | public function model(): UserProfile |
||
79 | 1 | ||
80 | /** |
||
81 | 1 | * Save profile |
|
82 | * |
||
83 | * @throws Exception |
||
84 | * @return UserProfile |
||
85 | 1 | */ |
|
86 | public function save(): UserProfile |
||
100 | } |
||
101 |