diff options
Diffstat (limited to 'src/Wallabag/Wallabag/User.php')
-rw-r--r-- | src/Wallabag/Wallabag/User.php | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/Wallabag/Wallabag/User.php b/src/Wallabag/Wallabag/User.php new file mode 100644 index 00000000..4a10c2ed --- /dev/null +++ b/src/Wallabag/Wallabag/User.php | |||
@@ -0,0 +1,59 @@ | |||
1 | <?php | ||
2 | /** | ||
3 | * wallabag, self hostable application allowing you to not miss any content anymore | ||
4 | * | ||
5 | * @category wallabag | ||
6 | * @author Nicolas LÅ“uillet <nicolas@loeuillet.org> | ||
7 | * @copyright 2013 | ||
8 | * @license http://opensource.org/licenses/MIT see COPYING file | ||
9 | */ | ||
10 | |||
11 | namespace Wallabag\Wallabag; | ||
12 | |||
13 | class User | ||
14 | { | ||
15 | public $id; | ||
16 | public $username; | ||
17 | public $name; | ||
18 | public $password; | ||
19 | public $email; | ||
20 | public $config; | ||
21 | |||
22 | function __construct($user = array()) | ||
23 | { | ||
24 | if ($user != array()) { | ||
25 | $this->id = $user['id']; | ||
26 | $this->username = $user['username']; | ||
27 | $this->name = $user['name']; | ||
28 | $this->password = $user['password']; | ||
29 | $this->email = $user['email']; | ||
30 | $this->config = $user['config']; | ||
31 | } | ||
32 | } | ||
33 | |||
34 | public function getId() | ||
35 | { | ||
36 | return $this->id; | ||
37 | } | ||
38 | |||
39 | public function getUsername() | ||
40 | { | ||
41 | return $this->username; | ||
42 | } | ||
43 | |||
44 | public function setConfig($config) | ||
45 | { | ||
46 | $this->config = $config; | ||
47 | } | ||
48 | |||
49 | /** | ||
50 | * Returns configuration entry for a user | ||
51 | * | ||
52 | * @param $name | ||
53 | * @return bool | ||
54 | */ | ||
55 | public function getConfigValue($name) | ||
56 | { | ||
57 | return (isset($this->config[$name])) ? $this->config[$name] : FALSE; | ||
58 | } | ||
59 | } \ No newline at end of file | ||