1 | <?php |
||
23 | class ChangePasswordForm extends Model |
||
24 | { |
||
25 | public $password; |
||
26 | public $new_password; |
||
27 | public $new_password_repeat; |
||
28 | private $_user = false; |
||
29 | |||
30 | const SCENARIO_ADMIN = 'admin'; |
||
31 | |||
32 | public function attributeLabels() |
||
40 | |||
41 | public function rules() |
||
52 | |||
53 | public function clearAttributes() |
||
59 | |||
60 | /** |
||
61 | * Validates the password. |
||
62 | * This method serves as the inline validation for password. |
||
63 | * |
||
64 | * @param string $attribute the attribute currently being validated |
||
65 | * @param array $params the additional name-value pairs given in the rule |
||
66 | */ |
||
67 | public function validatePassword($attribute, $params) |
||
77 | |||
78 | /** |
||
79 | * Change password. |
||
80 | * @return boolean Whether the password changed. |
||
81 | */ |
||
82 | public function changePassword() |
||
95 | |||
96 | /** |
||
97 | * Set user. |
||
98 | * @param User $user |
||
99 | * @return bool |
||
100 | */ |
||
101 | public function setUser($user) |
||
110 | |||
111 | /** |
||
112 | * Finds user. |
||
113 | * |
||
114 | * @return User|null |
||
115 | */ |
||
116 | public function getUser() |
||
120 | |||
121 | /** |
||
122 | * This method adds ADMIN scenario, because the administrator does not need |
||
123 | * to know the original password when changing it. |
||
124 | * @return array scenarios. |
||
125 | */ |
||
126 | public function scenarios() |
||
132 | } |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.