1 | <?php |
||
6 | class ClassyUser extends ClassyBasis { |
||
|
|||
7 | |||
8 | /** |
||
9 | * Current user id. |
||
10 | * |
||
11 | * @var int |
||
12 | */ |
||
13 | public $ID; |
||
14 | |||
15 | /** |
||
16 | * User posts url. |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | public $link; |
||
21 | |||
22 | /** |
||
23 | * User login (example: anrw). |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | public $user_login; |
||
28 | |||
29 | /** |
||
30 | * User full name. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | public $name; |
||
35 | |||
36 | /** |
||
37 | * It's basically sanitized version of user login, used for permalinks. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | public $user_nicename; |
||
42 | |||
43 | /** |
||
44 | * User email. |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | public $user_email; |
||
49 | |||
50 | /** |
||
51 | * Human-Friendly name, like: Andrew Tolochka. |
||
52 | * |
||
53 | * @var string |
||
54 | */ |
||
55 | public $display_name; |
||
56 | |||
57 | /** |
||
58 | * Stores current user object. |
||
59 | * |
||
60 | * @var object |
||
61 | */ |
||
62 | private $object; |
||
63 | |||
64 | /** |
||
65 | * Main constructor function. Requires user id. |
||
66 | * |
||
67 | * @param int $uid User id. |
||
68 | */ |
||
69 | public function __construct( $uid = null ) { |
||
74 | |||
75 | /** |
||
76 | * Verify user id. |
||
77 | * |
||
78 | * @param int $uid User id. |
||
79 | * |
||
80 | * @return int |
||
81 | */ |
||
82 | private function verify_id( $uid ) { |
||
86 | |||
87 | /** |
||
88 | * Initialises User Instance. |
||
89 | */ |
||
90 | private function init() { |
||
97 | |||
98 | /** |
||
99 | * Returns user object. |
||
100 | * |
||
101 | * @return object |
||
102 | */ |
||
103 | private function get_object() { |
||
106 | |||
107 | /** |
||
108 | * Returns user first name. |
||
109 | * |
||
110 | * @return string |
||
111 | */ |
||
112 | public function first_name() { |
||
115 | |||
116 | /** |
||
117 | * Returns user display name. |
||
118 | * |
||
119 | * @return string |
||
120 | */ |
||
121 | public function display_name() { |
||
124 | |||
125 | /** |
||
126 | * Returns user full name. |
||
127 | * |
||
128 | * @return string |
||
129 | */ |
||
130 | public function name() { |
||
133 | |||
134 | /** |
||
135 | * Returns user user_login. |
||
136 | * |
||
137 | * @return string |
||
138 | */ |
||
139 | public function user_login() { |
||
142 | |||
143 | /** |
||
144 | * Returns user email. |
||
145 | * |
||
146 | * @return string |
||
147 | */ |
||
148 | public function email() { |
||
151 | |||
152 | /** |
||
153 | * Returns author posts url. |
||
154 | * |
||
155 | * @return string |
||
156 | */ |
||
157 | public function link() { |
||
164 | |||
165 | /** |
||
166 | * Setup user name and display name. |
||
167 | */ |
||
168 | private function setup_user_name() { |
||
176 | } |
||
177 |
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.