1 | <?php namespace Arcanedev\Socialite\OAuth; |
||
12 | class AbstractUser implements ArrayAccess, User |
||
13 | { |
||
14 | /* ------------------------------------------------------------------------------------------------ |
||
15 | | Properties |
||
16 | | ------------------------------------------------------------------------------------------------ |
||
17 | */ |
||
18 | /** |
||
19 | * The user's access token. |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | public $token; |
||
24 | |||
25 | /** |
||
26 | * The unique identifier for the user. |
||
27 | * |
||
28 | * @var mixed |
||
29 | */ |
||
30 | public $id; |
||
31 | |||
32 | /** |
||
33 | * The user's nickname / username. |
||
34 | * |
||
35 | * @var string |
||
36 | */ |
||
37 | public $nickname; |
||
38 | |||
39 | /** |
||
40 | * The user's full name. |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | public $name; |
||
45 | |||
46 | /** |
||
47 | * The user's e-mail address. |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | public $email; |
||
52 | |||
53 | /** |
||
54 | * The user's avatar image URL. |
||
55 | * |
||
56 | * @var string |
||
57 | */ |
||
58 | public $avatar; |
||
59 | |||
60 | /** |
||
61 | * The user's raw attributes. |
||
62 | * |
||
63 | * @var array |
||
64 | */ |
||
65 | public $user = []; |
||
66 | |||
67 | /* ------------------------------------------------------------------------------------------------ |
||
68 | | Getters & Setters |
||
69 | | ------------------------------------------------------------------------------------------------ |
||
70 | */ |
||
71 | /** |
||
72 | * Get the unique identifier for the user. |
||
73 | * |
||
74 | * @return string |
||
75 | */ |
||
76 | public function getId() |
||
80 | |||
81 | /** |
||
82 | * Get the nickname / username for the user. |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | public function getNickname() |
||
90 | |||
91 | /** |
||
92 | * Get the full name of the user. |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | public function getName() |
||
100 | |||
101 | /** |
||
102 | * Get the e-mail address of the user. |
||
103 | * |
||
104 | * @return string |
||
105 | */ |
||
106 | public function getEmail() |
||
110 | |||
111 | /** |
||
112 | * Get the avatar / image URL for the user. |
||
113 | * |
||
114 | * @return string |
||
115 | */ |
||
116 | public function getAvatar() |
||
120 | |||
121 | /** |
||
122 | * Get the raw user array. |
||
123 | * |
||
124 | * @return array |
||
125 | */ |
||
126 | public function getRaw() |
||
130 | |||
131 | /** |
||
132 | * Set the raw user array from the provider. |
||
133 | * |
||
134 | * @param array $user |
||
135 | * |
||
136 | * @return self |
||
137 | */ |
||
138 | 12 | public function setRaw(array $user) |
|
144 | |||
145 | /** |
||
146 | * Map the given array onto the user's properties. |
||
147 | * |
||
148 | * @param array $attributes |
||
149 | * |
||
150 | * @return self |
||
151 | */ |
||
152 | 18 | public function map(array $attributes) |
|
160 | |||
161 | /** |
||
162 | * Determine if the given raw user attribute exists. |
||
163 | * |
||
164 | * @param string $offset |
||
165 | * |
||
166 | * @return bool |
||
167 | */ |
||
168 | public function offsetExists($offset) |
||
172 | |||
173 | /** |
||
174 | * Get the given key from the raw user. |
||
175 | * |
||
176 | * @param string $offset |
||
177 | * |
||
178 | * @return mixed |
||
179 | */ |
||
180 | public function offsetGet($offset) |
||
184 | |||
185 | /** |
||
186 | * Set the given attribute on the raw user array. |
||
187 | * |
||
188 | * @param string $offset |
||
189 | * @param mixed $value |
||
190 | */ |
||
191 | public function offsetSet($offset, $value) |
||
195 | |||
196 | /** |
||
197 | * Unset the given value from the raw user array. |
||
198 | * |
||
199 | * @param string $offset |
||
200 | */ |
||
201 | public function offsetUnset($offset) |
||
205 | } |
||
206 |