public function &getAttribute($key, $default = null) { if (!$this->hasAttribute($key)) { return $default; } return $this->attributes[$key]; }