{
$result = array();
- if (isset($attrs)) {
- foreach ($attrs as $key) {
- $value = $this->get($key);
- $result[$key] = $value;
- }
+ /**
+ * Return all supported attributes if no specific attributes were
+ * requested.
+ */
+ if (empty($attrs)) {
+ $attrs = array_keys($this->attributes);
+ }
+
+ foreach ($attrs as $key) {
+ $value = $this->get($key);
+ $result[$key] = $value;
}
return $result;
$result = $this->server->save($this->uid, $info, $this->exists());
- $this->_exists = true;
- $this->_cache = array_merge($this->_cache, $info);
+ if (!$this->_exists) {
+ $this->_exists = true;
+ $this->_cache = $info;
+ } else {
+ $this->_cache = array_merge($this->_cache, $info);
+ }
return $result;
}