-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathUser.php
More file actions
34 lines (30 loc) · 1000 Bytes
/
User.php
File metadata and controls
34 lines (30 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
class User extends Connector {
// data stored in this object
protected $user;
public function __construct($options){
parent::__construct($options);
$this->connect();
}
public function user_load($uid) {
return (object)$this->requestSend($this->_methods->USER_LOAD, array($uid));
}
public function user_save($uid, $user) {
if(is_object($user)){
$user = (array)$user;
}
return $this->requestSend($this->_methods->USER_SAVE, array($uid, $user));
}
public function user_create($user) {
if(is_array($user)){
$user = (object)$user;
}
return $this->requestSend($this->_methods->USER_CREATE, array($user));
}
public function user_delete($uid) {
return $this->requestSend($this->_methods->USER_DELETE, array($uid));
}
public function user_list($page = 0, $fields = '*', $parameters = array(), $pagesize = 20){
return $this->requestSend($this->_methods->USER_LIST, array($page, $fields, $parameters, $pagesize));
}
}