-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUser.php
More file actions
45 lines (36 loc) · 812 Bytes
/
Copy pathUser.php
File metadata and controls
45 lines (36 loc) · 812 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
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* Created by PhpStorm.
* User: ExE
* Date: 27.01.17
* Time: 12:01
*/
require_once "APIObject.php";
class User extends APIObject {
public $id;
public $name;
public $username;
public $email;
public $created_at;
public $updated_at;
public $display_username;
/**
* @param null $data
*/
function __construct($data = null) {
if ($data != null) {
$this->assign_results($data);
}
}
/**
* @param null $user_id int
* @return $this
*/
public function fetch($user_id = null) {
if ($user_id == null)
$user_id = $this->id;
$resp = $this->send_get("https://app.pipefy.com/users/$user_id.json", null, null);
$this->assign_results($resp);
return $this;
}
}