function getAttributes() { $ret = array(); foreach ($this as $name => $value) { $ret[$name] = $value; } return $ret; }