1 | <?php |
||
10 | class SignupProviderForm extends \yii\base\Model |
||
11 | { |
||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | public $email; |
||
16 | /** |
||
17 | * @var \app\models\User |
||
18 | */ |
||
19 | private $user = null; |
||
20 | |||
21 | 8 | public function __construct($user) |
|
25 | |||
26 | /** |
||
27 | * @inheritdoc |
||
28 | */ |
||
29 | 8 | public function rules() |
|
42 | |||
43 | /** |
||
44 | * @inheritdoc |
||
45 | */ |
||
46 | 7 | public function attributeLabels() |
|
50 | |||
51 | /** |
||
52 | * Save photo |
||
53 | * |
||
54 | * @param \app\models\UserProfile $profile |
||
55 | * @param string $photo |
||
56 | * @return void |
||
57 | */ |
||
58 | 6 | private function savePhoto($profile, $photo) |
|
68 | |||
69 | /** |
||
70 | * Signs user up |
||
71 | * |
||
72 | * @param bool $checkExistEmail |
||
73 | * @return \app\models\User |
||
74 | */ |
||
75 | 8 | public function signup($checkExistEmail = true) |
|
94 | |||
95 | /** |
||
96 | * Sends an email with a link, for confirm the email |
||
97 | * |
||
98 | * @return boolean |
||
99 | */ |
||
100 | 5 | public function sendEmail() |
|
117 | } |
||
118 |
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: