<?php
/**
- * poche, a read it later open source system
+ * wallabag, self hostable application allowing you to not miss any content anymore
*
- * @category poche
- * @author Nicolas LÅ“uillet <support@inthepoche.com>
+ * @category wallabag
+ * @author Nicolas LÅ“uillet <nicolas@loeuillet.org>
* @copyright 2013
- * @license http://www.wtfpl.net/ see COPYING file
+ * @license http://opensource.org/licenses/MIT see COPYING file
*/
class User
public $email;
public $config;
- function __construct($user)
+ function __construct($user = array())
{
- $this->id = $user['id'];
- $this->username = $user['username'];
- $this->name = $user['name'];
- $this->password = $user['password'];
- $this->email = $user['email'];
- $this->config = $user['config'];
+ if ($user != array()) {
+ $this->id = $user['id'];
+ $this->username = $user['username'];
+ $this->name = $user['name'];
+ $this->password = $user['password'];
+ $this->email = $user['email'];
+ $this->config = $user['config'];
+ }
}
- function getConfigValue($name) {
+ public function getId()
+ {
+ return $this->id;
+ }
+
+ public function getUsername()
+ {
+ return $this->username;
+ }
+
+ public function setConfig($config)
+ {
+ $this->config = $config;
+ }
+
+ /**
+ * Returns configuration entry for a user
+ *
+ * @param $name
+ * @return bool
+ */
+ public function getConfigValue($name)
+ {
return (isset($this->config[$name])) ? $this->config[$name] : FALSE;
}
}
\ No newline at end of file