1 | <?php |
||
11 | class SignupProviderForm extends \yii\base\Model |
||
12 | { |
||
13 | /** |
||
14 | * @var string |
||
15 | */ |
||
16 | public $email; |
||
17 | /** |
||
18 | * @var \app\models\User |
||
19 | */ |
||
20 | private $user = null; |
||
21 | |||
22 | /** |
||
23 | * @param User $user |
||
24 | */ |
||
25 | public function __construct($user, $email) |
||
30 | |||
31 | /** |
||
32 | * @inheritdoc |
||
33 | */ |
||
34 | public function rules() |
||
47 | |||
48 | /** |
||
49 | * @inheritdoc |
||
50 | */ |
||
51 | public function attributeLabels() |
||
55 | |||
56 | /** |
||
57 | * Create manually UploadedFile instance by file path |
||
58 | * |
||
59 | * @param string $path file path |
||
60 | * @return UploadedFile |
||
61 | */ |
||
62 | private function makeUploadedFile($path) |
||
76 | |||
77 | /** |
||
78 | * Save photo |
||
79 | * |
||
80 | * @param \app\models\UserProfile $profile |
||
81 | * @param string $photo |
||
82 | * @return void |
||
83 | */ |
||
84 | private function savePhoto($profile, $photo) |
||
93 | |||
94 | /** |
||
95 | * Save user |
||
96 | * |
||
97 | * @return bool |
||
98 | */ |
||
99 | public function saveUser() |
||
115 | |||
116 | /** |
||
117 | * Login |
||
118 | * |
||
119 | * @return bool |
||
120 | */ |
||
121 | public function login() |
||
125 | |||
126 | /** |
||
127 | * Signs user up |
||
128 | * |
||
129 | * @return bool |
||
130 | */ |
||
131 | public function signup() |
||
139 | |||
140 | /** |
||
141 | * Sends an email with a link, for confirm the email |
||
142 | * |
||
143 | * @return boolean |
||
144 | */ |
||
145 | public function sendEmail() |
||
162 | } |
||
163 |
If you implement
__call
and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.This is often the case, when
__call
is implemented by a parent class and only the child class knows which methods exist: