1 | <?php |
||
3 | class EmailChangeForm extends CFormModel |
||
|
|||
4 | { |
||
5 | /** |
||
6 | * The user's existing password |
||
7 | * @var string $password |
||
8 | */ |
||
9 | public $password; |
||
10 | |||
11 | /** |
||
12 | * The veification key |
||
13 | * @var string $verificationKey |
||
14 | */ |
||
15 | public $verificationKey; |
||
16 | |||
17 | /** |
||
18 | * The user model |
||
19 | * @var Users $_user |
||
20 | */ |
||
21 | private $_user; |
||
22 | |||
23 | /** |
||
24 | * The new email address change key |
||
25 | * @var UserMetadata $_newEmailAddressChangeKey |
||
26 | */ |
||
27 | private $_newEmailAddressChangeKey; |
||
28 | |||
29 | /** |
||
30 | * The new email address record on file |
||
31 | * @var UserMetadata $_newEmailAddress |
||
32 | */ |
||
33 | private $_newEmailAddress; |
||
34 | |||
35 | /** |
||
36 | * Validation rules |
||
37 | * @return array |
||
38 | */ |
||
39 | public function rules() |
||
48 | |||
49 | /** |
||
50 | * Attribute labels |
||
51 | * @return array |
||
52 | */ |
||
53 | public function attributeLabels() |
||
60 | |||
61 | /** |
||
62 | * Sets the user model |
||
63 | * @param Users $user |
||
64 | */ |
||
65 | public function setUser($user) |
||
69 | |||
70 | /** |
||
71 | * Validates the tokens supplied and that the request hasn't expired |
||
72 | * @param array $attributes |
||
73 | * @param array $params |
||
74 | * return array |
||
75 | */ |
||
76 | public function validateVerificationKey($attributes = array(), $params = array()) |
||
103 | |||
104 | /** |
||
105 | * Ensures that the password entered matches the one provided during registration |
||
106 | * @param array $attributes |
||
107 | * @param array $params |
||
108 | * return array |
||
109 | */ |
||
110 | public function validateUserPassword($attributes, $params) |
||
122 | |||
123 | /** |
||
124 | * Updates the user's email address and rehashes their password since the password is bound to the email |
||
125 | * @return boolean |
||
126 | */ |
||
127 | public function save() |
||
146 | |||
147 | /** |
||
148 | * Retrieves the user's email address from the model |
||
149 | * @return string |
||
150 | */ |
||
151 | public function getEmail() |
||
155 | } |
||
156 |
You can fix this by adding a namespace to your class:
When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.