1 | <?php |
||
11 | class User extends LazyResource |
||
12 | { |
||
13 | /** |
||
14 | * The primary id or some other id that can be used to fetch user information. |
||
15 | * |
||
16 | * @var string |
||
17 | */ |
||
18 | public $id; |
||
19 | |||
20 | /** |
||
21 | * @var UserIdentifiers |
||
22 | */ |
||
23 | protected $_identifiers; |
||
24 | |||
25 | /** |
||
26 | * @var ContactInfo |
||
27 | */ |
||
28 | protected $_contact_info; |
||
29 | |||
30 | /** |
||
31 | * @var UserStatistics |
||
32 | */ |
||
33 | protected $_user_statistics; |
||
34 | |||
35 | /** |
||
36 | * @var Loans |
||
37 | */ |
||
38 | public $loans; |
||
39 | |||
40 | /** |
||
41 | * @var Fees |
||
42 | */ |
||
43 | public $fees; |
||
44 | |||
45 | /** |
||
46 | * @var Requests |
||
47 | */ |
||
48 | public $requests; |
||
49 | |||
50 | /** |
||
51 | * User constructor. |
||
52 | * |
||
53 | * @param Client $client |
||
54 | * @param string $id |
||
55 | */ |
||
56 | public function __construct(Client $client, $id) |
||
64 | |||
65 | /** |
||
66 | * Get the user id the object was constructed with. This might or might not be the primary id. |
||
67 | * The only usefulness of this method over getPrimaryId() is that it will not trigger loading of the full object. |
||
68 | * |
||
69 | * @return string |
||
70 | */ |
||
71 | public function getUserId() |
||
75 | |||
76 | /** |
||
77 | * Get the primary id. No need to load the full record for this. |
||
78 | * |
||
79 | * @return string|null |
||
80 | */ |
||
81 | public function getPrimaryId() |
||
85 | |||
86 | /** |
||
87 | * Get the user identifiers. |
||
88 | * |
||
89 | * @return UserIdentifiers |
||
90 | */ |
||
91 | public function getIdentifiers() |
||
95 | |||
96 | /** |
||
97 | * Get the user's contact info. |
||
98 | */ |
||
99 | public function getContactInfo() |
||
103 | |||
104 | /** |
||
105 | * Get the user's statistics info. |
||
106 | */ |
||
107 | public function getStatistics() |
||
111 | |||
112 | /** |
||
113 | * Save the user |
||
114 | * |
||
115 | * @return string The API response body |
||
116 | */ |
||
117 | public function save() |
||
122 | |||
123 | /** |
||
124 | * Check if we have the full representation of our data object. |
||
125 | * |
||
126 | * @param \stdClass $data |
||
127 | * |
||
128 | * @return bool |
||
129 | */ |
||
130 | protected function isInitialized($data) |
||
134 | |||
135 | /** |
||
136 | * Called when data is available to be processed. |
||
137 | * |
||
138 | * @param mixed $data |
||
139 | */ |
||
140 | protected function onData($data) |
||
146 | |||
147 | /** |
||
148 | * Generate the base URL for this resource. |
||
149 | * |
||
150 | * @return string |
||
151 | */ |
||
152 | protected function urlBase() |
||
156 | |||
157 | public function __get($key) |
||
184 | } |
||
185 |