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 Loans |
||
32 | */ |
||
33 | public $loans; |
||
34 | |||
35 | /** |
||
36 | * @var Fees |
||
37 | */ |
||
38 | public $fees; |
||
39 | |||
40 | /** |
||
41 | * @var Requests |
||
42 | */ |
||
43 | public $requests; |
||
44 | |||
45 | /** |
||
46 | * User constructor. |
||
47 | * |
||
48 | * @param Client $client |
||
49 | * @param string $id |
||
50 | */ |
||
51 | public function __construct(Client $client, $id) |
||
59 | |||
60 | /** |
||
61 | * Get the user id the object was constructed with. This might or might not be the primary id. |
||
62 | * The only usefulness of this method over getPrimaryId() is that it will not trigger loading of the full object. |
||
63 | * |
||
64 | * @return string |
||
65 | */ |
||
66 | public function getUserId() |
||
70 | |||
71 | /** |
||
72 | * Get the primary id. No need to load the full record for this. |
||
73 | * |
||
74 | * @return string|null |
||
75 | */ |
||
76 | public function getPrimaryId() |
||
80 | |||
81 | /** |
||
82 | * Get the user identifiers. |
||
83 | * |
||
84 | * @return UserIdentifiers |
||
85 | */ |
||
86 | public function getIdentifiers() |
||
90 | |||
91 | /** |
||
92 | * Get the user's contact info. |
||
93 | */ |
||
94 | public function getContactInfo() |
||
98 | |||
99 | /** |
||
100 | * Save the user |
||
101 | * |
||
102 | * @return string The API response body |
||
103 | */ |
||
104 | public function save() |
||
109 | |||
110 | /** |
||
111 | * Check if we have the full representation of our data object. |
||
112 | * |
||
113 | * @param \stdClass $data |
||
114 | * |
||
115 | * @return bool |
||
116 | */ |
||
117 | protected function isInitialized($data) |
||
121 | |||
122 | /** |
||
123 | * Called when data is available to be processed. |
||
124 | * |
||
125 | * @param mixed $data |
||
126 | */ |
||
127 | protected function onData($data) |
||
132 | |||
133 | /** |
||
134 | * Generate the base URL for this resource. |
||
135 | * |
||
136 | * @return string |
||
137 | */ |
||
138 | protected function urlBase() |
||
142 | |||
143 | public function __get($key) |
||
170 | } |
||
171 |