public function load() { $sd = new modl\SessionxDAO(); $session = $sd->get(self::$_sessionid); if (isset($session)) { $this->_user = $session->username; $this->_password = $session->password; $this->_hash = $session->hash; $this->_resource = $session->resource; $this->_host = $session->host; $this->_config = unserialize($session->config); $this->_active = $session->active; $this->_start = $session->start; $this->_timestamp = $session->timestamp; } self::$_instance = $this; }
public function __set($key, $value) { if ($key == 'config') { $value = serialize($value); } elseif ($key == 'user') { $key = 'username'; } if ($key == 'id') { $this->_id = $value; self::$_instance = $this; } else { $sd = new modl\SessionxDAO(); $sd->update(self::$_sessionid, $key, $value); } }