1 | <?php |
||
31 | class Properties { |
||
32 | /** |
||
33 | * @var int |
||
34 | */ |
||
35 | protected $id; |
||
36 | /** |
||
37 | * Creating of object and saving user id inside |
||
38 | * |
||
39 | * @param int $user |
||
40 | */ |
||
41 | function __construct ($user) { |
||
44 | /** |
||
45 | * Get data item of user |
||
46 | * |
||
47 | * @param string|string[] $item |
||
48 | * |
||
49 | * @return false|string|mixed[] |
||
50 | */ |
||
51 | function get ($item) { |
||
54 | /** |
||
55 | * Set data item of specified user |
||
56 | * |
||
57 | * @param array|string $item |
||
58 | * @param mixed|null $value |
||
59 | * |
||
60 | * @return bool |
||
61 | */ |
||
62 | function set ($item, $value = null) { |
||
65 | /** |
||
66 | * Get data item of user |
||
67 | * |
||
68 | * @param string|string[] $item |
||
69 | * |
||
70 | * @return array|false|string |
||
71 | */ |
||
72 | function __get ($item) { |
||
75 | /** |
||
76 | * Get user avatar, if no one present - uses Gravatar |
||
77 | * |
||
78 | * @param int|null $size Avatar size, if not specified or resizing is not possible - original image is used |
||
79 | * |
||
80 | * @return string |
||
81 | */ |
||
82 | function avatar ($size = null) { |
||
85 | /** |
||
86 | * Get user name or login or email, depending on existing information |
||
87 | * |
||
88 | * @return string |
||
89 | */ |
||
90 | function username () { |
||
93 | /** |
||
94 | * Set data item of user |
||
95 | * |
||
96 | * @param array|string $item |
||
97 | * @param mixed|null $value |
||
98 | */ |
||
99 | function __set ($item, $value = null) { |
||
102 | /** |
||
103 | * Getting additional data item(s) of specified user |
||
104 | * |
||
105 | * @param string|string[] $item |
||
106 | * |
||
107 | * @return false|string|mixed[] |
||
108 | */ |
||
109 | function get_data ($item) { |
||
112 | /** |
||
113 | * Setting additional data item(s) of specified user |
||
114 | * |
||
115 | * @param array|string $item |
||
116 | * @param mixed|null $value |
||
117 | * |
||
118 | * @return bool |
||
119 | */ |
||
120 | function set_data ($item, $value = null) { |
||
123 | /** |
||
124 | * Deletion of additional data item(s) of specified user |
||
125 | * |
||
126 | * @param string|string[] $item |
||
127 | * |
||
128 | * @return bool |
||
129 | */ |
||
130 | function del_data ($item) { |
||
133 | } |
||
134 |