Total Complexity | 5 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
11 | class PasswordResetRequestForm extends Model |
||
12 | { |
||
13 | public $email; |
||
14 | |||
15 | |||
16 | /** |
||
17 | * {@inheritdoc} |
||
18 | */ |
||
19 | public function rules() |
||
20 | { |
||
21 | return [ |
||
22 | ['email', 'trim'], |
||
23 | ['email', 'required'], |
||
24 | ['email', 'email'], |
||
25 | ['email', 'exist', |
||
26 | 'targetClass' => User::class, |
||
27 | 'filter' => ['status' => User::STATUS_ACTIVE], |
||
28 | 'message' => 'There is no user with this email address.' |
||
29 | ], |
||
30 | ]; |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * Sends an email with a link, for resetting the password. |
||
35 | * |
||
36 | * @return bool whether the email was send |
||
37 | */ |
||
38 | public function sendEmail() |
||
67 | } |
||
68 | } |
||
69 |