Conditions | 1 |
Paths | 1 |
Total Lines | 15 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
22 | public function rules() |
||
23 | { |
||
24 | $targetClass = Yii::$app->get('auth')->modelMap['user']['class']; |
||
25 | |||
26 | return [ |
||
27 | ['email', 'filter', 'filter' => 'trim'], |
||
28 | ['email', 'required'], |
||
29 | ['email', 'email'], |
||
30 | ['email', 'exist', |
||
31 | 'targetClass' => $targetClass, |
||
32 | 'targetAttribute' => $targetClass::attributesMap()['fieldEmail'], |
||
33 | 'message' => 'There is no user with such email.', |
||
34 | ], |
||
35 | ]; |
||
36 | } |
||
37 | |||
71 |